Skip to content

Commit

Permalink
search en
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed May 23, 2022
1 parent 7f257d3 commit e94854d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sphinx/search/en.py
Expand Up @@ -2,8 +2,9 @@

from typing import Dict

import snowballstemmer

from sphinx.search import SearchLanguage
from sphinx.util.stemmer import get_stemmer

english_stopwords = set("""
a and are as at
Expand Down Expand Up @@ -211,7 +212,7 @@ class SearchEnglish(SearchLanguage):
stopwords = english_stopwords

def init(self, options: Dict) -> None:
self.stemmer = get_stemmer()
self.stemmer = snowballstemmer.stemmer('english')

def stem(self, word: str) -> str:
return self.stemmer.stem(word.lower())
return self.stemmer.stemWord(word.lower())

0 comments on commit e94854d

Please sign in to comment.