Update lucene version to 8.3.0
This commit is contained in:
parent
356d9d9ae9
commit
0c8992fd80
@ -30,7 +30,7 @@ ik-analyzer for solr 7.x-8.x
|
|||||||
|
|
||||||
|
|
||||||
## 使用说明
|
## 使用说明
|
||||||
* jar包下载地址:[](https://search.maven.org/remotecontent?filepath=com/github/magese/ik-analyzer/8.2.0/ik-analyzer-8.2.0.jar)
|
* jar包下载地址:[](https://search.maven.org/remotecontent?filepath=com/github/magese/ik-analyzer/8.3.0/ik-analyzer-8.3.0.jar)
|
||||||
* 历史版本:[](https://search.maven.org/search?q=g:com.github.magese%20AND%20a:ik-analyzer&core=gav)
|
* 历史版本:[](https://search.maven.org/search?q=g:com.github.magese%20AND%20a:ik-analyzer&core=gav)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
@ -38,7 +38,7 @@ ik-analyzer for solr 7.x-8.x
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.magese</groupId>
|
<groupId>com.github.magese</groupId>
|
||||||
<artifactId>ik-analyzer</artifactId>
|
<artifactId>ik-analyzer</artifactId>
|
||||||
<version>8.2.0</version>
|
<version>8.3.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
4
pom.xml
4
pom.xml
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<groupId>com.github.magese</groupId>
|
<groupId>com.github.magese</groupId>
|
||||||
<artifactId>ik-analyzer</artifactId>
|
<artifactId>ik-analyzer</artifactId>
|
||||||
<version>8.2.0</version>
|
<version>8.3.0</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>ik-analyzer-solr</name>
|
<name>ik-analyzer-solr</name>
|
||||||
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<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.src.version>1.8</javac.src.version>
|
||||||
<javac.target.version>1.8</javac.target.version>
|
<javac.target.version>1.8</javac.target.version>
|
||||||
<maven.compiler.plugin.version>3.3</maven.compiler.plugin.version>
|
<maven.compiler.plugin.version>3.3</maven.compiler.plugin.version>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IK 中文分词 版本 8.2.0
|
* IK 中文分词 版本 8.3.0
|
||||||
* IK Analyzer release 8.2.0
|
* IK Analyzer release 8.3.0
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -21,8 +21,8 @@
|
|||||||
* 版权声明 2012,乌龙茶工作室
|
* 版权声明 2012,乌龙茶工作室
|
||||||
* provided by Linliangyi and copyright 2012 by Oolong studio
|
* provided by Linliangyi and copyright 2012 by Oolong studio
|
||||||
*
|
*
|
||||||
* 8.2.0版本 由 Magese (magese@live.cn) 更新
|
* 8.3.0版本 由 Magese (magese@live.cn) 更新
|
||||||
* release 8.2.0 update by Magese(magese@live.cn)
|
* release 8.3.0 update by Magese(magese@live.cn)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.wltea.analyzer.core;
|
package org.wltea.analyzer.core;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IK 中文分词 版本 8.2.0
|
* IK 中文分词 版本 8.3.0
|
||||||
* IK Analyzer release 8.2.0
|
* IK Analyzer release 8.3.0
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -21,8 +21,8 @@
|
|||||||
* 版权声明 2012,乌龙茶工作室
|
* 版权声明 2012,乌龙茶工作室
|
||||||
* provided by Linliangyi and copyright 2012 by Oolong studio
|
* provided by Linliangyi and copyright 2012 by Oolong studio
|
||||||
*
|
*
|
||||||
* 8.2.0版本 由 Magese (magese@live.cn) 更新
|
* 8.3.0版本 由 Magese (magese@live.cn) 更新
|
||||||
* release 8.2.0 update by Magese(magese@live.cn)
|
* release 8.3.0 update by Magese(magese@live.cn)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.wltea.analyzer.core;
|
package org.wltea.analyzer.core;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IK 中文分词 版本 8.2.0
|
* IK 中文分词 版本 8.3.0
|
||||||
* IK Analyzer release 8.2.0
|
* IK Analyzer release 8.3.0
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -21,8 +21,8 @@
|
|||||||
* 版权声明 2012,乌龙茶工作室
|
* 版权声明 2012,乌龙茶工作室
|
||||||
* provided by Linliangyi and copyright 2012 by Oolong studio
|
* provided by Linliangyi and copyright 2012 by Oolong studio
|
||||||
*
|
*
|
||||||
* 8.2.0版本 由 Magese (magese@live.cn) 更新
|
* 8.3.0版本 由 Magese (magese@live.cn) 更新
|
||||||
* release 8.2.0 update by Magese(magese@live.cn)
|
* release 8.3.0 update by Magese(magese@live.cn)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.wltea.analyzer.core;
|
package org.wltea.analyzer.core;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IK 中文分词 版本 8.2.0
|
* IK 中文分词 版本 8.3.0
|
||||||
* IK Analyzer release 8.2.0
|
* IK Analyzer release 8.3.0
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -21,8 +21,8 @@
|
|||||||
* 版权声明 2012,乌龙茶工作室
|
* 版权声明 2012,乌龙茶工作室
|
||||||
* provided by Linliangyi and copyright 2012 by Oolong studio
|
* provided by Linliangyi and copyright 2012 by Oolong studio
|
||||||
*
|
*
|
||||||
* 8.2.0版本 由 Magese (magese@live.cn) 更新
|
* 8.3.0版本 由 Magese (magese@live.cn) 更新
|
||||||
* release 8.2.0 update by Magese(magese@live.cn)
|
* release 8.3.0 update by Magese(magese@live.cn)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.wltea.analyzer.core;
|
package org.wltea.analyzer.core;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IK 中文分词 版本 8.2.0
|
* IK 中文分词 版本 8.3.0
|
||||||
* IK Analyzer release 8.2.0
|
* IK Analyzer release 8.3.0
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -21,8 +21,8 @@
|
|||||||
* 版权声明 2012,乌龙茶工作室
|
* 版权声明 2012,乌龙茶工作室
|
||||||
* provided by Linliangyi and copyright 2012 by Oolong studio
|
* provided by Linliangyi and copyright 2012 by Oolong studio
|
||||||
*
|
*
|
||||||
* 8.2.0版本 由 Magese (magese@live.cn) 更新
|
* 8.3.0版本 由 Magese (magese@live.cn) 更新
|
||||||
* release 8.2.0 update by Magese(magese@live.cn)
|
* release 8.3.0 update by Magese(magese@live.cn)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.wltea.analyzer.core;
|
package org.wltea.analyzer.core;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IK 中文分词 版本 8.2.0
|
* IK 中文分词 版本 8.3.0
|
||||||
* IK Analyzer release 8.2.0
|
* IK Analyzer release 8.3.0
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -21,21 +21,21 @@
|
|||||||
* 版权声明 2012,乌龙茶工作室
|
* 版权声明 2012,乌龙茶工作室
|
||||||
* provided by Linliangyi and copyright 2012 by Oolong studio
|
* provided by Linliangyi and copyright 2012 by Oolong studio
|
||||||
*
|
*
|
||||||
* 8.2.0版本 由 Magese (magese@live.cn) 更新
|
* 8.3.0版本 由 Magese (magese@live.cn) 更新
|
||||||
* release 8.2.0 update by Magese(magese@live.cn)
|
* release 8.3.0 update by Magese(magese@live.cn)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.wltea.analyzer.core;
|
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.IOException;
|
||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.wltea.analyzer.cfg.Configuration;
|
|
||||||
import org.wltea.analyzer.cfg.DefaultConfig;
|
|
||||||
import org.wltea.analyzer.dic.Dictionary;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IK分词器主类
|
* IK分词器主类
|
||||||
*/
|
*/
|
||||||
@ -58,7 +58,6 @@ public final class IKSegmenter {
|
|||||||
*
|
*
|
||||||
* @param input 读取流
|
* @param input 读取流
|
||||||
* @param useSmart 为true,使用智能分词策略
|
* @param useSmart 为true,使用智能分词策略
|
||||||
* <p>
|
|
||||||
* 非智能分词:细粒度输出所有可能的切分结果
|
* 非智能分词:细粒度输出所有可能的切分结果
|
||||||
* 智能分词: 合并数词和量词,对分词结果进行歧义判断
|
* 智能分词: 合并数词和量词,对分词结果进行歧义判断
|
||||||
*/
|
*/
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IK 中文分词 版本 8.2.0
|
* IK 中文分词 版本 8.3.0
|
||||||
* IK Analyzer release 8.2.0
|
* IK Analyzer release 8.3.0
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -21,8 +21,8 @@
|
|||||||
* 版权声明 2012,乌龙茶工作室
|
* 版权声明 2012,乌龙茶工作室
|
||||||
* provided by Linliangyi and copyright 2012 by Oolong studio
|
* provided by Linliangyi and copyright 2012 by Oolong studio
|
||||||
*
|
*
|
||||||
* 8.2.0版本 由 Magese (magese@live.cn) 更新
|
* 8.3.0版本 由 Magese (magese@live.cn) 更新
|
||||||
* release 8.2.0 update by Magese(magese@live.cn)
|
* release 8.3.0 update by Magese(magese@live.cn)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.wltea.analyzer.core;
|
package org.wltea.analyzer.core;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IK 中文分词 版本 8.2.0
|
* IK 中文分词 版本 8.3.0
|
||||||
* IK Analyzer release 8.2.0
|
* IK Analyzer release 8.3.0
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -21,8 +21,8 @@
|
|||||||
* 版权声明 2012,乌龙茶工作室
|
* 版权声明 2012,乌龙茶工作室
|
||||||
* provided by Linliangyi and copyright 2012 by Oolong studio
|
* provided by Linliangyi and copyright 2012 by Oolong studio
|
||||||
*
|
*
|
||||||
* 8.2.0版本 由 Magese (magese@live.cn) 更新
|
* 8.3.0版本 由 Magese (magese@live.cn) 更新
|
||||||
* release 8.2.0 update by Magese(magese@live.cn)
|
* release 8.3.0 update by Magese(magese@live.cn)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.wltea.analyzer.core;
|
package org.wltea.analyzer.core;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IK 中文分词 版本 8.2.0
|
* IK 中文分词 版本 8.3.0
|
||||||
* IK Analyzer release 8.2.0
|
* IK Analyzer release 8.3.0
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -21,8 +21,8 @@
|
|||||||
* 版权声明 2012,乌龙茶工作室
|
* 版权声明 2012,乌龙茶工作室
|
||||||
* provided by Linliangyi and copyright 2012 by Oolong studio
|
* provided by Linliangyi and copyright 2012 by Oolong studio
|
||||||
*
|
*
|
||||||
* 8.2.0版本 由 Magese (magese@live.cn) 更新
|
* 8.3.0版本 由 Magese (magese@live.cn) 更新
|
||||||
* release 8.2.0 update by Magese(magese@live.cn)
|
* release 8.3.0 update by Magese(magese@live.cn)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.wltea.analyzer.core;
|
package org.wltea.analyzer.core;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IK 中文分词 版本 8.2.0
|
* IK 中文分词 版本 8.3.0
|
||||||
* IK Analyzer release 8.2.0
|
* IK Analyzer release 8.3.0
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -21,8 +21,8 @@
|
|||||||
* 版权声明 2012,乌龙茶工作室
|
* 版权声明 2012,乌龙茶工作室
|
||||||
* provided by Linliangyi and copyright 2012 by Oolong studio
|
* provided by Linliangyi and copyright 2012 by Oolong studio
|
||||||
*
|
*
|
||||||
* 8.2.0版本 由 Magese (magese@live.cn) 更新
|
* 8.3.0版本 由 Magese (magese@live.cn) 更新
|
||||||
* release 8.2.0 update by Magese(magese@live.cn)
|
* release 8.3.0 update by Magese(magese@live.cn)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.wltea.analyzer.core;
|
package org.wltea.analyzer.core;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* IK 中文分词 版本 8.2.0
|
* IK 中文分词 版本 8.3.0
|
||||||
* IK Analyzer release 8.2.0
|
* IK Analyzer release 8.2.0
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IK 中文分词 版本 8.2.0
|
* IK 中文分词 版本 8.3.0
|
||||||
* IK Analyzer release 8.2.0
|
* IK Analyzer release 8.3.0
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -21,8 +21,8 @@
|
|||||||
* 版权声明 2012,乌龙茶工作室
|
* 版权声明 2012,乌龙茶工作室
|
||||||
* provided by Linliangyi and copyright 2012 by Oolong studio
|
* provided by Linliangyi and copyright 2012 by Oolong studio
|
||||||
*
|
*
|
||||||
* 8.2.0版本 由 Magese (magese@live.cn) 更新
|
* 8.3.0版本 由 Magese (magese@live.cn) 更新
|
||||||
* release 8.2.0 update by Magese(magese@live.cn)
|
* release 8.3.0 update by Magese(magese@live.cn)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.wltea.analyzer.dic;
|
package org.wltea.analyzer.dic;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IK 中文分词 版本 8.2.0
|
* IK 中文分词 版本 8.3.0
|
||||||
* IK Analyzer release 8.2.0
|
* IK Analyzer release 8.3.0
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -21,8 +21,8 @@
|
|||||||
* 版权声明 2012,乌龙茶工作室
|
* 版权声明 2012,乌龙茶工作室
|
||||||
* provided by Linliangyi and copyright 2012 by Oolong studio
|
* provided by Linliangyi and copyright 2012 by Oolong studio
|
||||||
*
|
*
|
||||||
* 8.2.0版本 由 Magese (magese@live.cn) 更新
|
* 8.3.0版本 由 Magese (magese@live.cn) 更新
|
||||||
* release 8.2.0 update by Magese(magese@live.cn)
|
* release 8.3.0 update by Magese(magese@live.cn)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.wltea.analyzer.dic;
|
package org.wltea.analyzer.dic;
|
||||||
@ -226,12 +226,13 @@ public class Dictionary {
|
|||||||
private void loadMainDict() {
|
private void loadMainDict() {
|
||||||
// 建立一个主词典实例
|
// 建立一个主词典实例
|
||||||
_MainDict = new DictSegment((char) 0);
|
_MainDict = new DictSegment((char) 0);
|
||||||
|
// 获取是否加载主词典
|
||||||
|
if (cfg.useMainDict()) {
|
||||||
// 读取主词典文件
|
// 读取主词典文件
|
||||||
InputStream is = this.getClass().getClassLoader().getResourceAsStream(cfg.getMainDictionary());
|
InputStream is = this.getClass().getClassLoader().getResourceAsStream(cfg.getMainDictionary());
|
||||||
if (is == null) {
|
if (is == null) {
|
||||||
throw new RuntimeException("Main Dictionary not found!!!");
|
throw new RuntimeException("Main Dictionary not found!!!");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
readDict(is, _MainDict);
|
readDict(is, _MainDict);
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
@ -245,6 +246,7 @@ public class Dictionary {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// 加载扩展词典
|
// 加载扩展词典
|
||||||
this.loadExtDict();
|
this.loadExtDict();
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IK 中文分词 版本 8.2.0
|
* IK 中文分词 版本 8.3.0
|
||||||
* IK Analyzer release 8.2.0
|
* IK Analyzer release 8.3.0
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -21,8 +21,8 @@
|
|||||||
* 版权声明 2012,乌龙茶工作室
|
* 版权声明 2012,乌龙茶工作室
|
||||||
* provided by Linliangyi and copyright 2012 by Oolong studio
|
* provided by Linliangyi and copyright 2012 by Oolong studio
|
||||||
*
|
*
|
||||||
* 8.2.0版本 由 Magese (magese@live.cn) 更新
|
* 8.3.0版本 由 Magese (magese@live.cn) 更新
|
||||||
* release 8.2.0 update by Magese(magese@live.cn)
|
* release 8.3.0 update by Magese(magese@live.cn)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.wltea.analyzer.dic;
|
package org.wltea.analyzer.dic;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IK 中文分词 版本 8.2.0
|
* IK 中文分词 版本 8.3.0
|
||||||
* IK Analyzer release 8.2.0
|
* IK Analyzer release 8.3.0
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -21,8 +21,8 @@
|
|||||||
* 版权声明 2012,乌龙茶工作室
|
* 版权声明 2012,乌龙茶工作室
|
||||||
* provided by Linliangyi and copyright 2012 by Oolong studio
|
* provided by Linliangyi and copyright 2012 by Oolong studio
|
||||||
*
|
*
|
||||||
* 8.2.0版本 由 Magese (magese@live.cn) 更新
|
* 8.3.0版本 由 Magese (magese@live.cn) 更新
|
||||||
* release 8.2.0 update by Magese(magese@live.cn)
|
* release 8.3.0 update by Magese(magese@live.cn)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.wltea.analyzer.lucene;
|
package org.wltea.analyzer.lucene;
|
||||||
@ -34,7 +34,7 @@ import org.apache.lucene.analysis.Tokenizer;
|
|||||||
* IK分词器,Lucene Analyzer接口实现
|
* IK分词器,Lucene Analyzer接口实现
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public final class IKAnalyzer extends Analyzer{
|
public final class IKAnalyzer extends Analyzer {
|
||||||
|
|
||||||
private boolean useSmart;
|
private boolean useSmart;
|
||||||
|
|
||||||
@ -42,16 +42,12 @@ public final class IKAnalyzer extends Analyzer{
|
|||||||
return useSmart;
|
return useSmart;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUseSmart(boolean useSmart) {
|
|
||||||
this.useSmart = useSmart;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IK分词器Lucene Analyzer接口实现类
|
* IK分词器Lucene Analyzer接口实现类
|
||||||
*
|
|
||||||
* 默认细粒度切分算法
|
* 默认细粒度切分算法
|
||||||
*/
|
*/
|
||||||
public IKAnalyzer(){
|
public IKAnalyzer() {
|
||||||
this(false);
|
this(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +56,7 @@ public final class IKAnalyzer extends Analyzer{
|
|||||||
*
|
*
|
||||||
* @param useSmart 当为true时,分词器进行智能切分
|
* @param useSmart 当为true时,分词器进行智能切分
|
||||||
*/
|
*/
|
||||||
public IKAnalyzer(boolean useSmart){
|
public IKAnalyzer(boolean useSmart) {
|
||||||
super();
|
super();
|
||||||
this.useSmart = useSmart;
|
this.useSmart = useSmart;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IK 中文分词 版本 8.2.0
|
* IK 中文分词 版本 8.3.0
|
||||||
* IK Analyzer release 8.2.0
|
* IK Analyzer release 8.3.0
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -21,8 +21,8 @@
|
|||||||
* 版权声明 2012,乌龙茶工作室
|
* 版权声明 2012,乌龙茶工作室
|
||||||
* provided by Linliangyi and copyright 2012 by Oolong studio
|
* provided by Linliangyi and copyright 2012 by Oolong studio
|
||||||
*
|
*
|
||||||
* 8.2.0版本 由 Magese (magese@live.cn) 更新
|
* 8.3.0版本 由 Magese (magese@live.cn) 更新
|
||||||
* release 8.2.0 update by Magese(magese@live.cn)
|
* release 8.3.0 update by Magese(magese@live.cn)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.wltea.analyzer.lucene;
|
package org.wltea.analyzer.lucene;
|
||||||
@ -81,7 +81,7 @@ public final class IKTokenizer extends Tokenizer {
|
|||||||
offsetAtt = addAttribute(OffsetAttribute.class);
|
offsetAtt = addAttribute(OffsetAttribute.class);
|
||||||
termAtt = addAttribute(CharTermAttribute.class);
|
termAtt = addAttribute(CharTermAttribute.class);
|
||||||
typeAtt = addAttribute(TypeAttribute.class);
|
typeAtt = addAttribute(TypeAttribute.class);
|
||||||
_IKImplement = new IKSegmenter(input , useSmart);
|
_IKImplement = new IKSegmenter(input, useSmart);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
@ -92,7 +92,7 @@ public final class IKTokenizer extends Tokenizer {
|
|||||||
//清除所有的词元属性
|
//清除所有的词元属性
|
||||||
clearAttributes();
|
clearAttributes();
|
||||||
Lexeme nextLexeme = _IKImplement.next();
|
Lexeme nextLexeme = _IKImplement.next();
|
||||||
if(nextLexeme != null){
|
if (nextLexeme != null) {
|
||||||
//将Lexeme转成Attributes
|
//将Lexeme转成Attributes
|
||||||
//设置词元文本
|
//设置词元文本
|
||||||
termAtt.append(nextLexeme.getLexemeText());
|
termAtt.append(nextLexeme.getLexemeText());
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IK 中文分词 版本 8.2.0
|
* IK 中文分词 版本 8.3.0
|
||||||
* IK Analyzer release 8.2.0
|
* IK Analyzer release 8.3.0
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -21,8 +21,8 @@
|
|||||||
* 版权声明 2012,乌龙茶工作室
|
* 版权声明 2012,乌龙茶工作室
|
||||||
* provided by Linliangyi and copyright 2012 by Oolong studio
|
* provided by Linliangyi and copyright 2012 by Oolong studio
|
||||||
*
|
*
|
||||||
* 8.2.0版本 由 Magese (magese@live.cn) 更新
|
* 8.3.0版本 由 Magese (magese@live.cn) 更新
|
||||||
* release 8.2.0 update by Magese(magese@live.cn)
|
* release 8.3.0 update by Magese(magese@live.cn)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.wltea.analyzer.lucene;
|
package org.wltea.analyzer.lucene;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IK 中文分词 版本 8.2.0
|
* IK 中文分词 版本 8.3.0
|
||||||
* IK Analyzer release 8.2.0
|
* IK Analyzer release 8.3.0
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -21,8 +21,8 @@
|
|||||||
* 版权声明 2012,乌龙茶工作室
|
* 版权声明 2012,乌龙茶工作室
|
||||||
* provided by Linliangyi and copyright 2012 by Oolong studio
|
* provided by Linliangyi and copyright 2012 by Oolong studio
|
||||||
*
|
*
|
||||||
* 8.2.0版本 由 Magese (magese@live.cn) 更新
|
* 8.3.0版本 由 Magese (magese@live.cn) 更新
|
||||||
* release 8.2.0 update by Magese(magese@live.cn)
|
* release 8.3.0 update by Magese(magese@live.cn)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.wltea.analyzer.lucene;
|
package org.wltea.analyzer.lucene;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IK 中文分词 版本 8.2.0
|
* IK 中文分词 版本 8.3.0
|
||||||
* IK Analyzer release 8.2.0
|
* IK Analyzer release 8.3.0
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -21,8 +21,8 @@
|
|||||||
* 版权声明 2012,乌龙茶工作室
|
* 版权声明 2012,乌龙茶工作室
|
||||||
* provided by Linliangyi and copyright 2012 by Oolong studio
|
* provided by Linliangyi and copyright 2012 by Oolong studio
|
||||||
*
|
*
|
||||||
* 8.2.0版本 由 Magese (magese@live.cn) 更新
|
* 8.3.0版本 由 Magese (magese@live.cn) 更新
|
||||||
* release 8.2.0 update by Magese(magese@live.cn)
|
* release 8.3.0 update by Magese(magese@live.cn)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.wltea.analyzer.query;
|
package org.wltea.analyzer.query;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IK 中文分词 版本 8.2.0
|
* IK 中文分词 版本 8.3.0
|
||||||
* IK Analyzer release 8.2.0
|
* IK Analyzer release 8.3.0
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -21,8 +21,8 @@
|
|||||||
* 版权声明 2012,乌龙茶工作室
|
* 版权声明 2012,乌龙茶工作室
|
||||||
* provided by Linliangyi and copyright 2012 by Oolong studio
|
* provided by Linliangyi and copyright 2012 by Oolong studio
|
||||||
*
|
*
|
||||||
* 8.2.0版本 由 Magese (magese@live.cn) 更新
|
* 8.3.0版本 由 Magese (magese@live.cn) 更新
|
||||||
* release 8.2.0 update by Magese(magese@live.cn)
|
* release 8.3.0 update by Magese(magese@live.cn)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.wltea.analyzer.query;
|
package org.wltea.analyzer.query;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IK 中文分词 版本 8.2.0
|
* IK 中文分词 版本 8.3.0
|
||||||
* IK Analyzer release 8.2.0
|
* IK Analyzer release 8.3.0
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -21,8 +21,8 @@
|
|||||||
* 版权声明 2012,乌龙茶工作室
|
* 版权声明 2012,乌龙茶工作室
|
||||||
* provided by Linliangyi and copyright 2012 by Oolong studio
|
* provided by Linliangyi and copyright 2012 by Oolong studio
|
||||||
*
|
*
|
||||||
* 8.2.0版本 由 Magese (magese@live.cn) 更新
|
* 8.3.0版本 由 Magese (magese@live.cn) 更新
|
||||||
* release 8.2.0 update by Magese(magese@live.cn)
|
* release 8.3.0 update by Magese(magese@live.cn)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.wltea.analyzer.sample;
|
package org.wltea.analyzer.sample;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IK 中文分词 版本 8.2.0
|
* IK 中文分词 版本 8.3.0
|
||||||
* IK Analyzer release 8.2.0
|
* IK Analyzer release 8.3.0
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -21,8 +21,8 @@
|
|||||||
* 版权声明 2012,乌龙茶工作室
|
* 版权声明 2012,乌龙茶工作室
|
||||||
* provided by Linliangyi and copyright 2012 by Oolong studio
|
* provided by Linliangyi and copyright 2012 by Oolong studio
|
||||||
*
|
*
|
||||||
* 8.2.0版本 由 Magese (magese@live.cn) 更新
|
* 8.3.0版本 由 Magese (magese@live.cn) 更新
|
||||||
* release 8.2.0 update by Magese(magese@live.cn)
|
* release 8.3.0 update by Magese(magese@live.cn)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.wltea.analyzer.sample;
|
package org.wltea.analyzer.sample;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user