Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ignoring non-Cyrillic words in RussianStemmer #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions summa/preprocessing/snowball.py
Original file line number Diff line number Diff line change
Expand Up @@ -2969,8 +2969,11 @@ def stem(self, word):
chr_exceeded = True
break

if chr_exceeded:
word = self.__cyrillic_to_roman(word)
# If there are no Cyrillic chars -> return as is
if not chr_exceeded:
return word

word = self.__cyrillic_to_roman(word)

step1_success = False
adjectival_removed = False
Expand Down Expand Up @@ -3115,8 +3118,7 @@ def stem(self, word):
if word.endswith("'"):
word = word[:-1]

if chr_exceeded:
word = self.__roman_to_cyrillic(word)
word = self.__roman_to_cyrillic(word)


return word
Expand Down