from pyhanlp import *
CustomDict = { "key":["xx","xxx"] } #为hanlp加载自定义词表 for keys in CustomDict: values = CustomDict[keys] for value in values: CustomDictionary.add(value, keys)
from pyhanlp import *
CustomDict = { "key":["xx","xxx"] } #为hanlp加载自定义词表 for keys in CustomDict: values = CustomDict[keys] for value in values: CustomDictionary.add(value, keys)