Skip to content

Commit 5ed3673

Browse files
committed
main code
1 parent aa3359b commit 5ed3673

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Stemmer.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from __future__ import unicode_literals
2+
from nltk.stem.api import StemmerI
3+
4+
class Stemmer(StemmerI):
5+
def __init__(self):
6+
self.ends = ['ên', 'an', 'yan', 'mend', 'em', 'êmin', 'in', 'tir']
7+
def stem(self, word):
8+
9+
10+
for end in self.ends:
11+
if word.endswith(end):
12+
word = word[:-len(end)]
13+
return word

0 commit comments

Comments
 (0)