Skip to content

Commit

Permalink
Change Komoran data default path
Browse files Browse the repository at this point in the history
  • Loading branch information
e9t committed Jan 13, 2015
1 parent 050efd3 commit 796c156
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 3 deletions.
Binary file added konlpy/java/data/models/irregular.model
Binary file not shown.
Binary file added konlpy/java/data/models/observation.model
Binary file not shown.
46 changes: 46 additions & 0 deletions konlpy/java/data/models/pos.table
@@ -0,0 +1,46 @@
XR 0
XSN 1
EC 2
JX 3
NR 4
NP 6
XSV 5
XSA 7
SS 8
VA 9
SW 10
IC 11
<start> 12
NNG 13
MAG 14
ETM 15
SF 16
SE 17
ETN 18
SH 19
MAJ 20
NNB 21
JKV 22
SL 23
MM 24
SN 25
SP 26
SO 28
JKQ 27
<end> 45
JKS 30
XPN 29
EP 31
JKO 32
VCP 33
VCN 34
NNP 36
XsV 35
JC 37
VV 38
EF 40
JKG 39
VX 42
NA 41
JKB 43
JKC 44
Binary file added konlpy/java/data/models/transition.model
Binary file not shown.
9 changes: 6 additions & 3 deletions konlpy/tag/_komoran.py
Expand Up @@ -51,8 +51,6 @@ class Komoran():
def pos(self, phrase, flatten=True):
"""POS tagger."""

# TODO: consider Python version

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

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

0 comments on commit 796c156

Please sign in to comment.