diff options
Diffstat (limited to 'sphinx/search/ru.py')
-rw-r--r-- | sphinx/search/ru.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sphinx/search/ru.py b/sphinx/search/ru.py index 8719ef1d2..9c0e30394 100644 --- a/sphinx/search/ru.py +++ b/sphinx/search/ru.py @@ -8,13 +8,11 @@ :license: BSD, see LICENSE for details. """ -from sphinx.search import SearchLanguage, parse_stop_word +from typing import Dict import snowballstemmer -if False: - # For type annotation - from typing import Any # NOQA +from sphinx.search import SearchLanguage, parse_stop_word russian_stopwords = parse_stop_word(''' @@ -259,10 +257,8 @@ class SearchRussian(SearchLanguage): js_stemmer_code = js_stemmer stopwords = russian_stopwords - def init(self, options): - # type: (Any) -> None + def init(self, options: Dict) -> None: self.stemmer = snowballstemmer.stemmer('russian') - def stem(self, word): - # type: (str) -> str + def stem(self, word: str) -> str: return self.stemmer.stemWord(word.lower()) |