Fix extracting max value in Word.guess_language().
This commit is contained in:
parent
807ab6291c
commit
c7743028b2
1 changed files with 1 additions and 1 deletions
|
|
@ -277,7 +277,7 @@ class Word(PageObject):
|
|||
return default
|
||||
for glyph_info in known_glyph_info:
|
||||
counts[language_map.get(glyph_info.text)] += 1
|
||||
language, count = sorted(counts.items(), reverse=True)[0]
|
||||
language = max(counts, key=lambda lang: counts[lang])
|
||||
return language
|
||||
|
||||
def guess_bold(self, *args, **kwargs):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue