Update lucene version to 8.3.0

This commit is contained in:
magese 2019-11-12 11:30:57 +08:00
parent 356d9d9ae9
commit 0c8992fd80
24 changed files with 222 additions and 225 deletions

View File

@ -30,7 +30,7 @@ ik-analyzer for solr 7.x-8.x
## 使用说明
* jar包下载地址[![GitHub version](https://img.shields.io/badge/version-8.2.0-519dd9.svg)](https://search.maven.org/remotecontent?filepath=com/github/magese/ik-analyzer/8.2.0/ik-analyzer-8.2.0.jar)
* jar包下载地址[![GitHub version](https://img.shields.io/badge/version-8.3.0-519dd9.svg)](https://search.maven.org/remotecontent?filepath=com/github/magese/ik-analyzer/8.3.0/ik-analyzer-8.3.0.jar)
* 历史版本:[![GitHub version](https://img.shields.io/maven-central/v/com.github.magese/ik-analyzer.svg?style=flat-square)](https://search.maven.org/search?q=g:com.github.magese%20AND%20a:ik-analyzer&core=gav)
```console
@ -38,7 +38,7 @@ ik-analyzer for solr 7.x-8.x
<dependency>
<groupId>com.github.magese</groupId>
<artifactId>ik-analyzer</artifactId>
<version>8.2.0</version>
<version>8.3.0</version>
</dependency>
```

View File

@ -4,7 +4,7 @@
<groupId>com.github.magese</groupId>
<artifactId>ik-analyzer</artifactId>
<version>8.2.0</version>
<version>8.3.0</version>
<packaging>jar</packaging>
<name>ik-analyzer-solr</name>
@ -13,7 +13,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<lucene.version>8.2.0</lucene.version>
<lucene.version>8.3.0</lucene.version>
<javac.src.version>1.8</javac.src.version>
<javac.target.version>1.8</javac.target.version>
<maven.compiler.plugin.version>3.3</maven.compiler.plugin.version>

View File

@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 8.2.0
* IK Analyzer release 8.2.0
* IK 中文分词 版本 8.3.0
* IK Analyzer release 8.3.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -21,8 +21,8 @@
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 8.2.0版本 Magese (magese@live.cn) 更新
* release 8.2.0 update by Magese(magese@live.cn)
* 8.3.0版本 Magese (magese@live.cn) 更新
* release 8.3.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.core;

View File

@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 8.2.0
* IK Analyzer release 8.2.0
* IK 中文分词 版本 8.3.0
* IK Analyzer release 8.3.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -21,8 +21,8 @@
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 8.2.0版本 Magese (magese@live.cn) 更新
* release 8.2.0 update by Magese(magese@live.cn)
* 8.3.0版本 Magese (magese@live.cn) 更新
* release 8.3.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.core;

View File

@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 8.2.0
* IK Analyzer release 8.2.0
* IK 中文分词 版本 8.3.0
* IK Analyzer release 8.3.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -21,8 +21,8 @@
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 8.2.0版本 Magese (magese@live.cn) 更新
* release 8.2.0 update by Magese(magese@live.cn)
* 8.3.0版本 Magese (magese@live.cn) 更新
* release 8.3.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.core;

View File

@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 8.2.0
* IK Analyzer release 8.2.0
* IK 中文分词 版本 8.3.0
* IK Analyzer release 8.3.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -21,8 +21,8 @@
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 8.2.0版本 Magese (magese@live.cn) 更新
* release 8.2.0 update by Magese(magese@live.cn)
* 8.3.0版本 Magese (magese@live.cn) 更新
* release 8.3.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.core;

View File

@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 8.2.0
* IK Analyzer release 8.2.0
* IK 中文分词 版本 8.3.0
* IK Analyzer release 8.3.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -21,8 +21,8 @@
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 8.2.0版本 Magese (magese@live.cn) 更新
* release 8.2.0 update by Magese(magese@live.cn)
* 8.3.0版本 Magese (magese@live.cn) 更新
* release 8.3.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.core;

View File

@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 8.2.0
* IK Analyzer release 8.2.0
* IK 中文分词 版本 8.3.0
* IK Analyzer release 8.3.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -21,21 +21,21 @@
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 8.2.0版本 Magese (magese@live.cn) 更新
* release 8.2.0 update by Magese(magese@live.cn)
* 8.3.0版本 Magese (magese@live.cn) 更新
* release 8.3.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.core;
import org.wltea.analyzer.cfg.Configuration;
import org.wltea.analyzer.cfg.DefaultConfig;
import org.wltea.analyzer.dic.Dictionary;
import java.io.IOException;
import java.io.Reader;
import java.util.ArrayList;
import java.util.List;
import org.wltea.analyzer.cfg.Configuration;
import org.wltea.analyzer.cfg.DefaultConfig;
import org.wltea.analyzer.dic.Dictionary;
/**
* IK分词器主类
*/
@ -58,7 +58,6 @@ public final class IKSegmenter {
*
* @param input 读取流
* @param useSmart 为true使用智能分词策略
* <p>
* 非智能分词细粒度输出所有可能的切分结果
* 智能分词 合并数词和量词对分词结果进行歧义判断
*/

View File

@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 8.2.0
* IK Analyzer release 8.2.0
* IK 中文分词 版本 8.3.0
* IK Analyzer release 8.3.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -21,8 +21,8 @@
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 8.2.0版本 Magese (magese@live.cn) 更新
* release 8.2.0 update by Magese(magese@live.cn)
* 8.3.0版本 Magese (magese@live.cn) 更新
* release 8.3.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.core;

View File

@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 8.2.0
* IK Analyzer release 8.2.0
* IK 中文分词 版本 8.3.0
* IK Analyzer release 8.3.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -21,8 +21,8 @@
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 8.2.0版本 Magese (magese@live.cn) 更新
* release 8.2.0 update by Magese(magese@live.cn)
* 8.3.0版本 Magese (magese@live.cn) 更新
* release 8.3.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.core;

View File

@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 8.2.0
* IK Analyzer release 8.2.0
* IK 中文分词 版本 8.3.0
* IK Analyzer release 8.3.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -21,8 +21,8 @@
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 8.2.0版本 Magese (magese@live.cn) 更新
* release 8.2.0 update by Magese(magese@live.cn)
* 8.3.0版本 Magese (magese@live.cn) 更新
* release 8.3.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.core;

View File

@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 8.2.0
* IK Analyzer release 8.2.0
* IK 中文分词 版本 8.3.0
* IK Analyzer release 8.3.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -21,8 +21,8 @@
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 8.2.0版本 Magese (magese@live.cn) 更新
* release 8.2.0 update by Magese(magese@live.cn)
* 8.3.0版本 Magese (magese@live.cn) 更新
* release 8.3.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.core;

View File

@ -1,5 +1,5 @@
/*
* IK 中文分词 版本 8.2.0
* IK 中文分词 版本 8.3.0
* IK Analyzer release 8.2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more

View File

@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 8.2.0
* IK Analyzer release 8.2.0
* IK 中文分词 版本 8.3.0
* IK Analyzer release 8.3.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -21,8 +21,8 @@
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 8.2.0版本 Magese (magese@live.cn) 更新
* release 8.2.0 update by Magese(magese@live.cn)
* 8.3.0版本 Magese (magese@live.cn) 更新
* release 8.3.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.dic;

View File

@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 8.2.0
* IK Analyzer release 8.2.0
* IK 中文分词 版本 8.3.0
* IK Analyzer release 8.3.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -21,8 +21,8 @@
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 8.2.0版本 Magese (magese@live.cn) 更新
* release 8.2.0 update by Magese(magese@live.cn)
* 8.3.0版本 Magese (magese@live.cn) 更新
* release 8.3.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.dic;
@ -226,12 +226,13 @@ public class Dictionary {
private void loadMainDict() {
// 建立一个主词典实例
_MainDict = new DictSegment((char) 0);
// 获取是否加载主词典
if (cfg.useMainDict()) {
// 读取主词典文件
InputStream is = this.getClass().getClassLoader().getResourceAsStream(cfg.getMainDictionary());
if (is == null) {
throw new RuntimeException("Main Dictionary not found!!!");
}
try {
readDict(is, _MainDict);
} catch (IOException ioe) {
@ -245,6 +246,7 @@ public class Dictionary {
e.printStackTrace();
}
}
}
// 加载扩展词典
this.loadExtDict();
}

View File

@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 8.2.0
* IK Analyzer release 8.2.0
* IK 中文分词 版本 8.3.0
* IK Analyzer release 8.3.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -21,8 +21,8 @@
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 8.2.0版本 Magese (magese@live.cn) 更新
* release 8.2.0 update by Magese(magese@live.cn)
* 8.3.0版本 Magese (magese@live.cn) 更新
* release 8.3.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.dic;

View File

@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 8.2.0
* IK Analyzer release 8.2.0
* IK 中文分词 版本 8.3.0
* IK Analyzer release 8.3.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -21,8 +21,8 @@
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 8.2.0版本 Magese (magese@live.cn) 更新
* release 8.2.0 update by Magese(magese@live.cn)
* 8.3.0版本 Magese (magese@live.cn) 更新
* release 8.3.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.lucene;
@ -34,7 +34,7 @@ import org.apache.lucene.analysis.Tokenizer;
* IK分词器Lucene Analyzer接口实现
*/
@SuppressWarnings("unused")
public final class IKAnalyzer extends Analyzer{
public final class IKAnalyzer extends Analyzer {
private boolean useSmart;
@ -42,16 +42,12 @@ public final class IKAnalyzer extends Analyzer{
return useSmart;
}
public void setUseSmart(boolean useSmart) {
this.useSmart = useSmart;
}
/**
* IK分词器Lucene Analyzer接口实现类
*
* 默认细粒度切分算法
*/
public IKAnalyzer(){
public IKAnalyzer() {
this(false);
}
@ -60,7 +56,7 @@ public final class IKAnalyzer extends Analyzer{
*
* @param useSmart 当为true时分词器进行智能切分
*/
public IKAnalyzer(boolean useSmart){
public IKAnalyzer(boolean useSmart) {
super();
this.useSmart = useSmart;
}

View File

@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 8.2.0
* IK Analyzer release 8.2.0
* IK 中文分词 版本 8.3.0
* IK Analyzer release 8.3.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -21,8 +21,8 @@
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 8.2.0版本 Magese (magese@live.cn) 更新
* release 8.2.0 update by Magese(magese@live.cn)
* 8.3.0版本 Magese (magese@live.cn) 更新
* release 8.3.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.lucene;
@ -81,7 +81,7 @@ public final class IKTokenizer extends Tokenizer {
offsetAtt = addAttribute(OffsetAttribute.class);
termAtt = addAttribute(CharTermAttribute.class);
typeAtt = addAttribute(TypeAttribute.class);
_IKImplement = new IKSegmenter(input , useSmart);
_IKImplement = new IKSegmenter(input, useSmart);
}
/* (non-Javadoc)
@ -92,7 +92,7 @@ public final class IKTokenizer extends Tokenizer {
//清除所有的词元属性
clearAttributes();
Lexeme nextLexeme = _IKImplement.next();
if(nextLexeme != null){
if (nextLexeme != null) {
//将Lexeme转成Attributes
//设置词元文本
termAtt.append(nextLexeme.getLexemeText());

View File

@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 8.2.0
* IK Analyzer release 8.2.0
* IK 中文分词 版本 8.3.0
* IK Analyzer release 8.3.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -21,8 +21,8 @@
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 8.2.0版本 Magese (magese@live.cn) 更新
* release 8.2.0 update by Magese(magese@live.cn)
* 8.3.0版本 Magese (magese@live.cn) 更新
* release 8.3.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.lucene;

View File

@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 8.2.0
* IK Analyzer release 8.2.0
* IK 中文分词 版本 8.3.0
* IK Analyzer release 8.3.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -21,8 +21,8 @@
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 8.2.0版本 Magese (magese@live.cn) 更新
* release 8.2.0 update by Magese(magese@live.cn)
* 8.3.0版本 Magese (magese@live.cn) 更新
* release 8.3.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.lucene;

View File

@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 8.2.0
* IK Analyzer release 8.2.0
* IK 中文分词 版本 8.3.0
* IK Analyzer release 8.3.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -21,8 +21,8 @@
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 8.2.0版本 Magese (magese@live.cn) 更新
* release 8.2.0 update by Magese(magese@live.cn)
* 8.3.0版本 Magese (magese@live.cn) 更新
* release 8.3.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.query;

View File

@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 8.2.0
* IK Analyzer release 8.2.0
* IK 中文分词 版本 8.3.0
* IK Analyzer release 8.3.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -21,8 +21,8 @@
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 8.2.0版本 Magese (magese@live.cn) 更新
* release 8.2.0 update by Magese(magese@live.cn)
* 8.3.0版本 Magese (magese@live.cn) 更新
* release 8.3.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.query;

View File

@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 8.2.0
* IK Analyzer release 8.2.0
* IK 中文分词 版本 8.3.0
* IK Analyzer release 8.3.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -21,8 +21,8 @@
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 8.2.0版本 Magese (magese@live.cn) 更新
* release 8.2.0 update by Magese(magese@live.cn)
* 8.3.0版本 Magese (magese@live.cn) 更新
* release 8.3.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.sample;

View File

@ -1,6 +1,6 @@
/*
* IK 中文分词 版本 8.2.0
* IK Analyzer release 8.2.0
* IK 中文分词 版本 8.3.0
* IK Analyzer release 8.3.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -21,8 +21,8 @@
* 版权声明 2012乌龙茶工作室
* provided by Linliangyi and copyright 2012 by Oolong studio
*
* 8.2.0版本 Magese (magese@live.cn) 更新
* release 8.2.0 update by Magese(magese@live.cn)
* 8.3.0版本 Magese (magese@live.cn) 更新
* release 8.3.0 update by Magese(magese@live.cn)
*
*/
package org.wltea.analyzer.sample;