From 4bd37f91e6dedacd1684764347eb4e187f929f10 Mon Sep 17 00:00:00 2001 From: c4n Date: Wed, 21 Sep 2016 20:37:06 +0700 Subject: [PATCH] python3 compatible --- LexTo.py | 3 ++- example.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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))