diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-12-25 05:41:54 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-12-25 05:41:54 +0300 |
commit | d717f5ae31d17533a5a20b581f571eb4a95b1b30 (patch) | |
tree | 65bb3a38edc57d2b5e70b19ca8996ccebd1e3951 /sphinx/search/sv.py | |
parent | d82e7c12a177a6a547ba1e72540f079f64590f8a (diff) | |
parent | 869ba4f67947b97af90dc706fb7e6ed17946ccd3 (diff) |
Merge branch '2.0'
Diffstat (limited to 'sphinx/search/sv.py')
-rw-r--r-- | sphinx/search/sv.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sphinx/search/sv.py b/sphinx/search/sv.py index cfdd15f92..4af7f7835 100644 --- a/sphinx/search/sv.py +++ b/sphinx/search/sv.py @@ -8,13 +8,12 @@ :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 +from sphinx.search import SearchLanguage, parse_stop_word + swedish_stopwords = parse_stop_word(''' | source: http://snowball.tartarus.org/algorithms/swedish/stop.txt @@ -147,10 +146,8 @@ class SearchSwedish(SearchLanguage): js_stemmer_code = js_stemmer stopwords = swedish_stopwords - def init(self, options): - # type: (Any) -> None + def init(self, options: Dict) -> None: self.stemmer = snowballstemmer.stemmer('swedish') - def stem(self, word): - # type: (str) -> str + def stem(self, word: str) -> str: return self.stemmer.stemWord(word.lower()) |