Skip to content

Commit 6e611e5

Browse files
committed
upgrade es to 6.2.4,hanlp to 1.6.4
Signed-off-by: Ranger Tsao <[email protected]>
1 parent 364a68b commit 6e611e5

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
buildscript {
22
ext {
3-
elasticserachVersion = '6.2.3'
4-
hanlpVersion = '1.5.3'
3+
elasticserachVersion = '6.2.4'
4+
hanlpVersion = '1.6.4'
55
}
66

77
repositories {
88
mavenLocal()
9+
maven { url = 'http://maven.aliyun.com/nexus/content/groups/public/' }
910
mavenCentral()
1011
jcenter()
1112
}
@@ -16,7 +17,7 @@ buildscript {
1617
}
1718

1819
group = 'io.shike'
19-
version = '6.2.3'
20+
version = '6.2.4'
2021

2122
repositories {
2223
mavenLocal()
@@ -61,7 +62,7 @@ bundlePlugin {
6162

6263
task mvn(type: Exec) {
6364
workingDir 'libs'
64-
commandLine 'mvn', 'install:install-file', '-Dfile=hanlp-$hanlpVersion.jar', '-DgroupId=com.hankcs', '-DartifactId=hanlp','-Dversion=1.5.3', '-Dpackaging=jar'
65+
commandLine 'mvn', 'install:install-file', '-Dfile=hanlp-1.6.4.jar', '-DgroupId=com.hankcs', '-DartifactId=hanlp','-Dversion=1.6.4', '-Dpackaging=jar'
6566
doLast {
6667
println('Installed hanlp')
6768
}

config/hanlp.properties

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#本配置文件中的路径的根目录,根目录+其他路径=完整路径(支持相对路径,请参考:https://github.com/hankcs/HanLP/pull/254)
22
#Windows用户请注意,路径分隔符统一使用/
3-
root = /${data.root}
3+
root = ${data root}
44
#核心词典路径
55
CoreDictionaryPath = data/dictionary/CoreNatureDictionary.txt
66
#2元语法词典路径
@@ -27,3 +27,12 @@ ShowTermNature = true
2727
#IO适配器,实现com.hankcs.hanlp.corpus.io.IIOAdapter接口以在不同的平台(Hadoop、Redis等)上运行HanLP
2828
#默认的IO适配器如下,该适配器是基于普通文件系统的。
2929
#IOAdapter=com.hankcs.hanlp.corpus.io.FileIOAdapter
30+
#感知机词法分析器
31+
PerceptronCWSModelPath = data/model/perceptron/pku199801/cws.bin
32+
PerceptronPOSModelPath = data/model/perceptron/pku199801/pos.bin
33+
PerceptronNERModelPath = data/model/perceptron/pku199801/ner.bin
34+
#CRF词法分析器
35+
CRFCWSModelPath = data/model/crf/pku199801/cws.bin
36+
CRFPOSModelPath = data/model/crf/pku199801/pos.bin
37+
CRFNERModelPath = data/model/crf/pku199801/ner.bin
38+
#更多配置项请参考 https://github.com/hankcs/HanLP/blob/master/src/main/java/com/hankcs/hanlp/HanLP.java#L59 自行添加

src/main/java/org/elasticsearch/index/analysis/HanLPTokenizerFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static HanLPTokenizerFactory createNLP(IndexSettings indexSettings, Envir
3939
return new HanLPTokenizerFactory(indexSettings, environment, name, settings) {
4040
@Override
4141
public Tokenizer create() {
42-
return new HanLPTokenizer(NLPTokenizer.SEGMENT, defaultStopWordDictionary, enablePorterStemming);
42+
return new HanLPTokenizer(NLPTokenizer.ANALYZER, defaultStopWordDictionary, enablePorterStemming);
4343
}
4444
};
4545
}

0 commit comments

Comments
 (0)