We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f7e3640 commit 3ad110cCopy full SHA for 3ad110c
pythainlp/postaggers/text.py
@@ -2,14 +2,15 @@
2
from nine import nimport,str
3
from pythainlp.segment import segment
4
import pythainlp
5
+import codecs
6
import os
7
json= nimport('json')
8
import nltk.tag, nltk.data
9
templates_dir = os.path.join(os.path.dirname(pythainlp.__file__), 'corpus')
10
template_file = os.path.join(templates_dir, 'thaipos.json')
11
#default_tagger = nltk.data.load(nltk.tag._POS_TAGGER)
12
def data():
- with open(template_file) as handle:
13
+ with codecs.open(template_file,'r',encoding='utf-8') as handle:
14
model = json.load(handle)
15
return model
16
data1 =data()
0 commit comments