Open chunpat opened 1 year ago
将CustomDictionary1.txt文件目录追加到hanlp.properties配置文件的CustomDictionaryPath自定义词典路径下试试,注意格式(有无空格解析逻辑是不一样的)。
将CustomDictionary1.txt文件目录追加到hanlp.properties配置文件的CustomDictionaryPath自定义词典路径下试试,注意格式(有无空格解析逻辑是不一样的)。
我那个案例是追加了的,跳过了这部分。后面看了有英文的案例,用全角英文处理。
自定义词库
vim plugins/analysis-hanlp/data/dictionary/custom/CustomDictionary1.txt
新建index
_analyze
curl -XGET "http://localhost:9200/test1/_analyze" -H 'Content-Type: application/json;charset=utf-8' -d' { "text": "IPHONEOPPOVIVO", "analyzer": "my_hanlp_analyzer" }'