Fixed bug in parse_author_best_book - we did not return author if the phrase with book contained only recognized author
@@ -393,10 +393,7 @@ def parse_author_best_book(annotated_phrase, default_phrase=None):
annotated_phrase['text'] = annotated_phrase['text'].split(' is ')[1]
plain_bookname, _ = get_name(annotated_phrase, 'book', return_plain=True)
if plain_bookname is None:
- author, _ = get_name(annotated_phrase, 'author')
- if author is None:
- logger.debug('Answer not obtained(no bookname no author)')
- return default_phrase
+ plain_author, _ = get_name(annotated_phrase, 'author', return_plain=True)
else:
logger.debug(f'Processing bookname {plain_bookname}')
plain_author = get_author(plain_bookname, return_plain=True, mode='book')
