Skip to content

Commit 36ad9ca

Browse files
author
kaldan007
committed
fix(trie): non inflectible word type error bug fix
1 parent 443f8fd commit 36ad9ca

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

botok/tries/trie.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ def add_non_inflectible(self, word):
120120
if not syls:
121121
return None
122122

123-
infl = self.__join_syls(syls)
124-
self.add(infl)
123+
# infl = self.__join_syls(syls)
124+
self.add(syls)
125125

126126
def inflect_n_modify_trie(self, word, deactivate=False, skrt=False):
127127
"""

tests/tokenizers/test_wordtokenizer.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,8 @@ def test_spaces_as_punct(wt):
126126
assert tokens[1].text == " "
127127
assert tokens[2].text == "ཀྲ་"
128128
assert tokens[8].text == " \n"
129+
130+
def test_particle_bug(wt):
131+
input_str = "བོད་གིས"
132+
tokens = wt.tokenize(input_str)
133+
assert tokens[1].pos == "PART"

0 commit comments

Comments
 (0)