Permalink
Browse files

Change Komoran data default path

  • Loading branch information...
1 parent 050efd3 commit 796c1563c1c952bdb1030effa4ed465f48e0d247 @e9t e9t committed Jan 13, 2015
Binary file not shown.
Binary file not shown.
@@ -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 not shown.
@@ -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)
@@ -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.