diff --git a/src/calibre/ebooks/oeb/polish/spell.py b/src/calibre/ebooks/oeb/polish/spell.py index 47c20f9e38..c460bf8bc9 100644 --- a/src/calibre/ebooks/oeb/polish/spell.py +++ b/src/calibre/ebooks/oeb/polish/spell.py @@ -9,7 +9,7 @@ __copyright__ = '2014, Kovid Goyal ' import sys from collections import defaultdict -from calibre.spell.break_iterator import has_break_iterator, split_into_words +from calibre.spell.break_iterator import split_into_words from calibre.spell.dictionary import parse_lang_code from calibre.ebooks.oeb.base import barename from calibre.ebooks.oeb.polish.container import OPF_NAMESPACES, get_container @@ -56,17 +56,12 @@ def filter_words(word): return False return True -if has_break_iterator: - def get_words(text, lang): - try: - ans = split_into_words(unicode(text), lang) - except (TypeError, ValueError): - return () - return filter(filter_words, ans) -else: - def get_words(text, lang): - p = patterns() - return filter(filter_words, p.split_pat.split(text)) +def get_words(text, lang): + try: + ans = split_into_words(unicode(text), lang) + except (TypeError, ValueError): + return () + return filter(filter_words, ans) def add_words(text, sourceline, words, file_name, locale): candidates = get_words(text, locale.langcode) diff --git a/src/calibre/spell/break_iterator.py b/src/calibre/spell/break_iterator.py index 5cca65630e..16f4da4110 100644 --- a/src/calibre/spell/break_iterator.py +++ b/src/calibre/spell/break_iterator.py @@ -14,8 +14,6 @@ from calibre.utils.localization import lang_as_iso639_1 _iterators = {} _lock = Lock() -has_break_iterator = hasattr(_icu, 'BreakIterator') - def split_into_words(text, lang='en'): with _lock: it = _iterators.get(lang, None)