当前位置: 首页 > 工具软件 > NLPIR > 使用案例 >

NLPIR

单嘉泽
2023-12-01
# coding: utf-8
import pynlpir
from pynlpir import nlpir

nlpir.Init(nlpir.PACKAGE_DIR, nlpir.UTF8_CODE, None)
nlpir.SetPOSmap(3)

f = open('D:/article.txt')
s = f.read()
print nlpir.ParagraphProcess(s, True)
f.close()

  

# coding: utf-8
import pynlpir
from pynlpir import nlpir

nlpir.Init(nlpir.PACKAGE_DIR, nlpir.UTF8_CODE, None)
nlpir.SetPOSmap(3)
nlpir.NWI_Start()
rs = nlpir.NWI_AddFile('D:/article.txt')
nlpir.NWI_Complete()
# li = nlpir.NWI_GetResult(rs)
nlpir.NWI_Result2UserDict(rs)
#print li
#nlpir.py
#New Word Identification
NWI_Start = get_func('NLPIR_NWI_Start',restype=c_bool)
NWI_AddFile = get_func('NLPIR_NWI_AddFile',[c_char_p], c_bool)
NWI_AddMem = get_func('NLPIR_NWI_AddMem',[c_char_p], c_bool)
NWI_Complete = get_func('NLPIR_NWI_Complete', restype=c_bool)
NWI_GetResult = get_func('NLPIR_NWI_GetResult',[c_int], c_char_p)
NWI_Result2UserDict = get_func('NLPIR_NWI_Result2UserDict',restype=c_uint)

  

  

转载于:https://www.cnblogs.com/bushe/p/4637701.html

相关阅读

相关文章

相关问答