Skip to content

Commit 796c156

Browse files
committed
Change Komoran data default path
1 parent 050efd3 commit 796c156

File tree

5 files changed

+52
-3
lines changed

5 files changed

+52
-3
lines changed
187 KB
Binary file not shown.
3.83 MB
Binary file not shown.

konlpy/java/data/models/pos.table

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
XR 0
2+
XSN 1
3+
EC 2
4+
JX 3
5+
NR 4
6+
NP 6
7+
XSV 5
8+
XSA 7
9+
SS 8
10+
VA 9
11+
SW 10
12+
IC 11
13+
<start> 12
14+
NNG 13
15+
MAG 14
16+
ETM 15
17+
SF 16
18+
SE 17
19+
ETN 18
20+
SH 19
21+
MAJ 20
22+
NNB 21
23+
JKV 22
24+
SL 23
25+
MM 24
26+
SN 25
27+
SP 26
28+
SO 28
29+
JKQ 27
30+
<end> 45
31+
JKS 30
32+
XPN 29
33+
EP 31
34+
JKO 32
35+
VCP 33
36+
VCN 34
37+
NNP 36
38+
XsV 35
39+
JC 37
40+
VV 38
41+
EF 40
42+
JKG 39
43+
VX 42
44+
NA 41
45+
JKB 43
46+
JKC 44
6.55 KB
Binary file not shown.

konlpy/tag/_komoran.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ class Komoran():
5151
def pos(self, phrase, flatten=True):
5252
"""POS tagger."""
5353

54-
# TODO: consider Python version
55-
5654
phrase = utils.preprocess(phrase)
5755
if sys.version_info[0] < 3:
5856
result = self.jki.analyzeMorphs(phrase, self.dicpath)
@@ -79,4 +77,9 @@ def __init__(self, jvmpath=None, dicpath='%s/java/data/models' % utils.installpa
7977
except TypeError: # Package kr.lucypark.komoran.KomoranInterface is not Callable
8078
raise IOError("Please download komoran-dic: `konlpy.download('komoran-dic')`")
8179

82-
self.dicpath = os.path.join(internals.get_datadir(), 'dictionaries', 'komoran-dic')
80+
if dicpath:
81+
self.dicpath = dicpath
82+
else:
83+
# FIXME: Cannot execute without sudoing
84+
# java.lang.NoClassDefFoundErrorPyRaisable: java.lang.NoClassDefFoundError: kr/co/shineware/nlp/komoran/core/analyzer/Komoran
85+
self.dicpath = os.path.join(utils.installpath, java, data, models)

0 commit comments

Comments
 (0)