diff --git a/LexTo.py b/LexTo.py index a719738..fd652a6 100644 --- a/LexTo.py +++ b/LexTo.py @@ -1,4 +1,5 @@ #!/usr/bin/python +# -*- coding: utf-8 -*- import jpype import os @@ -22,7 +23,7 @@ def tokenize(self, line): self.lexto.wordInstance(line) typeList = self.lexto.getTypeList() - typeList = [self.typeString[n] for n in typeList] + typeList = [self.typeString[n.value] for n in typeList] wordList = [] begin = self.lexto.first() diff --git a/example.py b/example.py index d287851..5b72b54 100644 --- a/example.py +++ b/example.py @@ -8,5 +8,5 @@ text = u"อยากรู้เรื่องยาคูลท์ ถามสาวยาคูลท์สิคะ" words, types = lexto.tokenize(text) -print '|'.join(words) -print '|'.join(types) +print('|'.join(words)) +print('|'.join(types))