Skip to content

Commit f678d70

Browse files
committed
Change from marisa_trie to our own Trie implementation
1 parent 565fd3f commit f678d70

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

pythainlp/tokenize/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import warnings
77
from typing import Iterable, List, Union
88

9-
from marisa_trie import Trie
9+
from .trie import Trie
1010
from pythainlp.corpus import thai_syllables, thai_words
1111

1212
DEFAULT_DICT_TRIE = Trie(thai_words())

pythainlp/tokenize/deepcut.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import deepcut
1212

13-
from marisa_trie import Trie
13+
from .trie import Trie
1414

1515

1616
def segment(text: str, custom_dict: Union[Trie, List[str], str] = None) -> List[str]:

pythainlp/tokenize/longest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from pythainlp.tokenize import DEFAULT_DICT_TRIE
1616

17-
from marisa_trie import Trie
17+
from .trie import Trie
1818

1919
_FRONT_DEP_CHAR = [
2020
"ะ",

pythainlp/tokenize/multi_cut.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
from pythainlp.tokenize import DEFAULT_DICT_TRIE
1919

20-
from marisa_trie import Trie
20+
from .trie import Trie
2121

2222

2323
class LatticeString(str):

pythainlp/tokenize/newmm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from heapq import heappop, heappush # for priority queue
1717
from typing import List
1818

19-
from marisa_trie import Trie
19+
from .trie import Trie
2020
from pythainlp.tokenize import DEFAULT_DICT_TRIE
2121

2222
from .tcc import tcc_pos

0 commit comments

Comments
 (0)