nltkor 1.2.18__cp39-cp39-macosx_10_9_universal2.whl → 1.2.19__cp39-cp39-macosx_10_9_universal2.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nltkor/__init__.py +1 -1
- nltkor/search/__init__.py +1 -1
- nltkor/search/test.py +25 -0
- nltkor/search/{search_dict.py → trie_search.py} +10 -10
- nltkor/tag/libs/__init__.py +0 -0
- nltkor/tag/libs/arguments.py +0 -0
- nltkor/tag/libs/attributes.py +0 -0
- nltkor/tag/libs/metadata.py +0 -0
- nltkor/tag/libs/ner/__init__.py +0 -0
- nltkor/tag/libs/ner/macmorphoreader.py +0 -0
- nltkor/tag/libs/ner/ner_reader.py +0 -0
- nltkor/tag/libs/network.c +125 -125
- nltkor/tag/libs/network.cpython-39-darwin.so +0 -0
- nltkor/tag/libs/parse/__init__.py +0 -0
- nltkor/tag/libs/parse/parse_reader.py +0 -0
- nltkor/tag/libs/pos/__init__.py +0 -0
- nltkor/tag/libs/pos/macmorphoreader.py +0 -0
- nltkor/tag/libs/pos/pos_reader.py +0 -0
- nltkor/tag/libs/srl/__init__.py +0 -0
- nltkor/tag/libs/srl/__srl_reader_.py +0 -0
- nltkor/tag/libs/srl/srl_reader.py +0 -0
- nltkor/tag/libs/srl/train_srl.py +0 -0
- nltkor/tag/libs/taggers.py +0 -0
- nltkor/tag/libs/word_dictionary.py +0 -0
- nltkor/tag/libs/wsd/__init__.py +0 -0
- nltkor/tag/libs/wsd/macmorphoreader.py +0 -0
- nltkor/tag/libs/wsd/wsd_reader.py +0 -0
- {nltkor-1.2.18.dist-info → nltkor-1.2.19.dist-info}/METADATA +16 -16
- {nltkor-1.2.18.dist-info → nltkor-1.2.19.dist-info}/RECORD +11 -10
- {nltkor-1.2.18.dist-info → nltkor-1.2.19.dist-info}/WHEEL +1 -1
- {nltkor-1.2.18.dist-info → nltkor-1.2.19.dist-info/licenses}/LICENSE.txt +0 -0
- {nltkor-1.2.18.dist-info → nltkor-1.2.19.dist-info}/top_level.txt +0 -0
nltkor/__init__.py
CHANGED
nltkor/search/__init__.py
CHANGED
nltkor/search/test.py
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
from trie_search import TRIESearch
|
2
|
+
|
3
|
+
root = {}
|
4
|
+
dict_file = '/Users/chanhyeok/Downloads/lexicon.txt'
|
5
|
+
sc = TRIESearch(root)
|
6
|
+
with open(dict_file, 'r') as f:
|
7
|
+
for line in f:
|
8
|
+
if ';;' in line[:2]: continue
|
9
|
+
k, v = line.strip().split('\t')
|
10
|
+
sc.build_trie_search(k, v)
|
11
|
+
# print(root)
|
12
|
+
word = '고용 노동부'
|
13
|
+
values, value_data = sc.trie_search(word, True)
|
14
|
+
print(values, value_data)
|
15
|
+
|
16
|
+
word = '2시뉴스외전'
|
17
|
+
values, value_data = sc.trie_search( word, True)
|
18
|
+
print(values, value_data)
|
19
|
+
word = '2시 뉴스외전'
|
20
|
+
values, value_data = sc.trie_search( word, True)
|
21
|
+
print(values, value_data)
|
22
|
+
|
23
|
+
word = 'gbc'
|
24
|
+
values, value_data = sc.trie_search( word, True)
|
25
|
+
print(values, value_data)
|
@@ -4,11 +4,11 @@ import numpy as np
|
|
4
4
|
import json
|
5
5
|
import argparse
|
6
6
|
|
7
|
-
class
|
7
|
+
class TRIESearch :
|
8
8
|
def __init__ (self,root) :
|
9
9
|
self.root = root
|
10
10
|
|
11
|
-
def
|
11
|
+
def build_trie_search(self, word, data) -> dict:
|
12
12
|
current_dict = self.root
|
13
13
|
_end_word_ = '$$'
|
14
14
|
for letter in word:
|
@@ -19,7 +19,7 @@ class SearchDic :
|
|
19
19
|
|
20
20
|
|
21
21
|
|
22
|
-
def
|
22
|
+
def trie_search(self, word, space_flag=False):
|
23
23
|
'''
|
24
24
|
TRIE 탐색
|
25
25
|
space_flag: if True then including space, otherwise do not including space
|
@@ -69,27 +69,27 @@ class SearchDic :
|
|
69
69
|
return pickle.load(f)
|
70
70
|
if __name__ == "__main__":
|
71
71
|
root = {}
|
72
|
-
dict_file = '
|
73
|
-
sc =
|
72
|
+
dict_file = '텍스트파일 경로'
|
73
|
+
sc = TRIESearch(root)
|
74
74
|
with open(dict_file, 'r') as f:
|
75
75
|
for line in f:
|
76
76
|
if ';;' in line[:2]: continue
|
77
77
|
k, v = line.strip().split('\t')
|
78
|
-
sc.
|
78
|
+
sc.build_trie_search(k, v)
|
79
79
|
# print(root)
|
80
80
|
word = '고용 노동부'
|
81
|
-
values, value_data = sc.
|
81
|
+
values, value_data = sc.trie_search(word, True)
|
82
82
|
print(values, value_data)
|
83
83
|
|
84
84
|
word = '2시뉴스외전'
|
85
|
-
values, value_data = sc.
|
85
|
+
values, value_data = sc.trie_search( word, True)
|
86
86
|
print(values, value_data)
|
87
87
|
word = '2시 뉴스외전'
|
88
|
-
values, value_data = sc.
|
88
|
+
values, value_data = sc.trie_search( word, True)
|
89
89
|
print(values, value_data)
|
90
90
|
|
91
91
|
word = 'gbc'
|
92
|
-
values, value_data = sc.
|
92
|
+
values, value_data = sc.trie_search( word, True)
|
93
93
|
print(values, value_data)
|
94
94
|
|
95
95
|
|
nltkor/tag/libs/__init__.py
CHANGED
File without changes
|
nltkor/tag/libs/arguments.py
CHANGED
File without changes
|
nltkor/tag/libs/attributes.py
CHANGED
File without changes
|
nltkor/tag/libs/metadata.py
CHANGED
File without changes
|
nltkor/tag/libs/ner/__init__.py
CHANGED
File without changes
|
File without changes
|
File without changes
|