提交 84692191 编写于 作者: S Steffy-zxf 提交者: wuzewu

Modify the coding format of senta_demo.py and lac_demo.py (#50)

上级 c8704585
...@@ -19,10 +19,10 @@ if __name__ == "__main__": ...@@ -19,10 +19,10 @@ if __name__ == "__main__":
results = lac.lexical_analysis(data=inputs) results = lac.lexical_analysis(data=inputs)
for result in results: for result in results:
if six.PY2: if six.PY2:
print(json.dumps( print(
result['word'], encoding="utf8", ensure_ascii=False)) json.dumps(result['word'], encoding="utf8", ensure_ascii=False))
print(json.dumps( print(
result['tag'], encoding="utf8", ensure_ascii=False)) json.dumps(result['tag'], encoding="utf8", ensure_ascii=False))
else: else:
print(result['word']) print(result['word'])
print(result['tag']) print(result['tag'])
...@@ -21,7 +21,7 @@ if __name__ == "__main__": ...@@ -21,7 +21,7 @@ if __name__ == "__main__":
results[index]["text"] = text results[index]["text"] = text
for index, result in enumerate(results): for index, result in enumerate(results):
if six.PY2: if six.PY2:
print(json.dumps( print(
results[index], encoding="utf8", ensure_ascii=False)) json.dumps(results[index], encoding="utf8", ensure_ascii=False))
else: else:
print(results[index]) print(results[index])
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册