Skip to content

Apache Lucene open-source search software

LUCENE-1882: move SmartChineseAnalyzer to the 'correct' package ... this commit is based on a sequence of svn commands and a patch provided by Robert Muir in LUCENE-1862

Chris M. Hostettere5cb7f668a91
diff --git a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/package.html b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/package.html
deleted file mode 100644
index d9d596f1fca..00000000000
--- a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/package.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
-</head>
-<body>
-<div>
-Analyzer for Simplified Chinese, which indexes words.
-</div>
-<div>
-<font color="#FF0000">
-WARNING: The status of the analyzers/smartcn <b>analysis.cn</b> package is experimental. The APIs
-and file formats introduced here might change in the future and will not be supported anymore
-in such a case.
-</font>
-</div>
-<div>
-Three analyzers are provided for Chinese, each of which treats Chinese text in a different way.
-<ul>
- <li>ChineseAnalyzer (in the analyzers/cn package): Index unigrams (individual Chinese characters) as a token.
- <li>CJKAnalyzer (in the analyzers/cjk package): Index bigrams (overlapping groups of two adjacent Chinese characters) as tokens.
- <li>SmartChineseAnalyzer (in this package): Index words (attempt to segment Chinese text into words) as tokens.
-</ul>
-
-Example phrase: "我是中国人"
-<ol>
- <li>ChineseAnalyzer: 我-是-中-国-人</li>
- <li>CJKAnalyzer: 我是-是中-中国-国人</li>
- <li>SmartChineseAnalyzer: 我-是-中国-人</li>
-</ol>
-</div>
-
-</body>
-</html>
diff --git a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/AnalyzerProfile.java b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/AnalyzerProfile.java
index bd2fe299b05..a3239110744 100644
--- a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/AnalyzerProfile.java
+++ b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/AnalyzerProfile.java
@@ -28,7 +28,7 @@ import java.util.Properties;
* SmartChineseAnalyzer has a built-in dictionary and stopword list out-of-box.
* </p>
* <p><font color="#FF0000">
- * WARNING: The status of the analyzers/smartcn <b>analysis.cn</b> package is experimental.
+ * WARNING: The status of the analyzers/smartcn <b>analysis.cn.smart</b> package is experimental.
* The APIs and file formats introduced here might change in the future and will not be
* supported anymore in such a case.</font>
* </p>
diff --git a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/CharType.java b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/CharType.java
index 539509fe132..e9c237ce4ac 100644
--- a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/CharType.java
+++ b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/CharType.java
@@ -20,7 +20,7 @@ package org.apache.lucene.analysis.cn.smart;
/**
* Internal SmartChineseAnalyzer character type constants.
* <p><font color="#FF0000">
- * WARNING: The status of the analyzers/smartcn <b>analysis.cn</b> package is experimental.
+ * WARNING: The status of the analyzers/smartcn <b>analysis.cn.smart</b> package is experimental.
* The APIs and file formats introduced here might change in the future and will not be
* supported anymore in such a case.</font>
* </p>
diff --git a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/SentenceTokenizer.java b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/SentenceTokenizer.java
index 0c41842cd7d..21195c31444 100644
--- a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/SentenceTokenizer.java
+++ b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/SentenceTokenizer.java
@@ -32,7 +32,7 @@ import org.apache.lucene.util.AttributeSource;
* The output tokens can then be broken into words with {@link WordTokenFilter}
* </p>
* <p><font color="#FF0000">
- * WARNING: The status of the analyzers/smartcn <b>analysis.cn</b> package is experimental.
+ * WARNING: The status of the analyzers/smartcn <b>analysis.cn.smart</b> package is experimental.
* The APIs and file formats introduced here might change in the future and will not be
* supported anymore in such a case.</font>
* </p>
diff --git a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/SmartChineseAnalyzer.java b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/SmartChineseAnalyzer.java
similarity index 97%
rename from contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/SmartChineseAnalyzer.java
rename to contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/SmartChineseAnalyzer.java
index 2b096218429..442c2651147 100644
--- a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/SmartChineseAnalyzer.java
+++ b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/SmartChineseAnalyzer.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.lucene.analysis.cn;
+package org.apache.lucene.analysis.cn.smart;
import java.io.IOException;
import java.io.InputStream;
@@ -51,7 +51,7 @@ import org.apache.lucene.analysis.cn.smart.WordTokenFilter;
* Thanks to ICTCLAS for their hard work, and for contributing the data under the Apache 2 License!
* </p>
* <p><font color="#FF0000">
- * WARNING: The status of the analyzers/smartcn <b>analysis.cn</b> package is experimental.
+ * WARNING: The status of the analyzers/smartcn <b>analysis.cn.smart</b> package is experimental.
* The APIs and file formats introduced here might change in the future and will not be
* supported anymore in such a case.</font>
* </p>
diff --git a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/Utility.java b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/Utility.java
index 36e73a14044..c9147f65041 100644
--- a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/Utility.java
+++ b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/Utility.java
@@ -22,7 +22,7 @@ import org.apache.lucene.analysis.cn.smart.hhmm.SegTokenFilter; // for javadoc
/**
* SmartChineseAnalyzer utility constants and methods
* <p><font color="#FF0000">
- * WARNING: The status of the analyzers/smartcn <b>analysis.cn</b> package is experimental.
+ * WARNING: The status of the analyzers/smartcn <b>analysis.cn.smart</b> package is experimental.
* The APIs and file formats introduced here might change in the future and will not be
* supported anymore in such a case.</font>
* </p>
diff --git a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/WordSegmenter.java b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/WordSegmenter.java
index 04378b1d618..4ca00cbc1c1 100644
--- a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/WordSegmenter.java
+++ b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/WordSegmenter.java
@@ -27,7 +27,7 @@ import org.apache.lucene.analysis.cn.smart.hhmm.SegTokenFilter;
/**
* Segment a sentence of Chinese text into words.
* <p><font color="#FF0000">
- * WARNING: The status of the analyzers/smartcn <b>analysis.cn</b> package is experimental.
+ * WARNING: The status of the analyzers/smartcn <b>analysis.cn.smart</b> package is experimental.
* The APIs and file formats introduced here might change in the future and will not be
* supported anymore in such a case.</font>
* </p>
diff --git a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/WordTokenFilter.java b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/WordTokenFilter.java
index 17b975711e7..91f23ee4c0c 100644
--- a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/WordTokenFilter.java
+++ b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/WordTokenFilter.java
@@ -31,7 +31,7 @@ import org.apache.lucene.analysis.tokenattributes.TypeAttribute;
/**
* A {@link TokenFilter} that breaks sentences into words.
* <p><font color="#FF0000">
- * WARNING: The status of the analyzers/smartcn <b>analysis.cn</b> package is experimental.
+ * WARNING: The status of the analyzers/smartcn <b>analysis.cn.smart</b> package is experimental.
* The APIs and file formats introduced here might change in the future and will not be
* supported anymore in such a case.</font>
* </p>
diff --git a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/WordType.java b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/WordType.java
index 8878ac58cf3..e1b12fcb411 100644
--- a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/WordType.java
+++ b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/WordType.java
@@ -20,7 +20,7 @@ package org.apache.lucene.analysis.cn.smart;
/**
* Internal SmartChineseAnalyzer token type constants
* <p><font color="#FF0000">
- * WARNING: The status of the analyzers/smartcn <b>analysis.cn</b> package is experimental.
+ * WARNING: The status of the analyzers/smartcn <b>analysis.cn.smart</b> package is experimental.
* The APIs and file formats introduced here might change in the future and will not be
* supported anymore in such a case.</font>
* </p>
diff --git a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/AbstractDictionary.java b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/AbstractDictionary.java
index 6ccebc1a1f4..9b37ae947c6 100644
--- a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/AbstractDictionary.java
+++ b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/AbstractDictionary.java
@@ -27,7 +27,7 @@ import java.io.UnsupportedEncodingException;
* Contains methods for dealing with GB2312 encoding.
* </p>
* <p><font color="#FF0000">
- * WARNING: The status of the analyzers/smartcn <b>analysis.cn</b> package is experimental.
+ * WARNING: The status of the analyzers/smartcn <b>analysis.cn.smart</b> package is experimental.
* The APIs and file formats introduced here might change in the future and will not be
* supported anymore in such a case.</font>
* </p>
diff --git a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BiSegGraph.java b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BiSegGraph.java
index e4816278f2c..ef37f159e64 100644
--- a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BiSegGraph.java
+++ b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BiSegGraph.java
@@ -32,7 +32,7 @@ import org.apache.lucene.analysis.cn.smart.Utility;
* For each start offset, a list of possible token pairs is stored.
* </p>
* <p><font color="#FF0000">
- * WARNING: The status of the analyzers/smartcn <b>analysis.cn</b> package is experimental.
+ * WARNING: The status of the analyzers/smartcn <b>analysis.cn.smart</b> package is experimental.
* The APIs and file formats introduced here might change in the future and will not be
* supported anymore in such a case.</font>
* </p>
diff --git a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BigramDictionary.java b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BigramDictionary.java
index 13f856957fa..8fa8e9dfef0 100644
--- a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BigramDictionary.java
+++ b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/BigramDictionary.java
@@ -35,7 +35,7 @@ import org.apache.lucene.analysis.cn.smart.AnalyzerProfile;
/**
* SmartChineseAnalyzer Bigram dictionary.
* <p><font color="#FF0000">
- * WARNING: The status of the analyzers/smartcn <b>analysis.cn</b> package is experimental.
+ * WARNING: The status of the analyzers/smartcn <b>analysis.cn.smart</b> package is experimental.
* The APIs and file formats introduced here might change in the future and will not be
* supported anymore in such a case.</font>
* </p>
diff --git a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/HHMMSegmenter.java b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/HHMMSegmenter.java
index 8e729caaf53..42008137091 100644
--- a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/HHMMSegmenter.java
+++ b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/HHMMSegmenter.java
@@ -27,7 +27,7 @@ import org.apache.lucene.analysis.cn.smart.hhmm.PathNode;//javadoc @link
/**
* Finds the optimal segmentation of a sentence into Chinese words
* <p><font color="#FF0000">
- * WARNING: The status of the analyzers/smartcn <b>analysis.cn</b> package is experimental.
+ * WARNING: The status of the analyzers/smartcn <b>analysis.cn.smart</b> package is experimental.
* The APIs and file formats introduced here might change in the future and will not be
* supported anymore in such a case.</font>
* </p>
diff --git a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/PathNode.java b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/PathNode.java
index 6e18279cfb6..47ad0304c69 100644
--- a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/PathNode.java
+++ b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/PathNode.java
@@ -23,7 +23,7 @@ package org.apache.lucene.analysis.cn.smart.hhmm;
* Used by {@link BiSegGraph} to maximize the segmentation with the Viterbi algorithm.
* </p>
* <p><font color="#FF0000">
- * WARNING: The status of the analyzers/smartcn <b>analysis.cn</b> package is experimental.
+ * WARNING: The status of the analyzers/smartcn <b>analysis.cn.smart</b> package is experimental.
* The APIs and file formats introduced here might change in the future and will not be
* supported anymore in such a case.</font>
* </p>
diff --git a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegGraph.java b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegGraph.java
index 45f868fd0eb..7228b5c7f54 100644
--- a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegGraph.java
+++ b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegGraph.java
@@ -29,7 +29,7 @@ import java.util.Map;
* For each start offset, a list of possible tokens is stored.
* </p>
* <p><font color="#FF0000">
- * WARNING: The status of the analyzers/smartcn <b>analysis.cn</b> package is experimental.
+ * WARNING: The status of the analyzers/smartcn <b>analysis.cn.smart</b> package is experimental.
* The APIs and file formats introduced here might change in the future and will not be
* supported anymore in such a case.</font>
* </p>
diff --git a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegToken.java b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegToken.java
index 9bc9427b27a..1536e6df75d 100644
--- a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegToken.java
+++ b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegToken.java
@@ -24,7 +24,7 @@ import org.apache.lucene.analysis.cn.smart.WordType; // for javadocs
/**
* SmartChineseAnalyzer internal token
* <p><font color="#FF0000">
- * WARNING: The status of the analyzers/smartcn <b>analysis.cn</b> package is experimental.
+ * WARNING: The status of the analyzers/smartcn <b>analysis.cn.smart</b> package is experimental.
* The APIs and file formats introduced here might change in the future and will not be
* supported anymore in such a case.</font>
* </p>
diff --git a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegTokenFilter.java b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegTokenFilter.java
index f9ac9d50c9b..ca8f766c547 100644
--- a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegTokenFilter.java
+++ b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegTokenFilter.java
@@ -26,7 +26,7 @@ import org.apache.lucene.analysis.cn.smart.WordType;
* Additionally, all punctuation is converted into {@link Utility#COMMON_DELIMITER}
* </p>
* <p><font color="#FF0000">
- * WARNING: The status of the analyzers/smartcn <b>analysis.cn</b> package is experimental.
+ * WARNING: The status of the analyzers/smartcn <b>analysis.cn.smart</b> package is experimental.
* The APIs and file formats introduced here might change in the future and will not be
* supported anymore in such a case.</font>
* </p>
diff --git a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegTokenPair.java b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegTokenPair.java
index 6a8e3aa31ab..11729bb2cd2 100644
--- a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegTokenPair.java
+++ b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/SegTokenPair.java
@@ -22,7 +22,7 @@ import java.util.Arrays;
/**
* A pair of tokens in {@link SegGraph}
* <p><font color="#FF0000">
- * WARNING: The status of the analyzers/smartcn <b>analysis.cn</b> package is experimental.
+ * WARNING: The status of the analyzers/smartcn <b>analysis.cn.smart</b> package is experimental.
* The APIs and file formats introduced here might change in the future and will not be
* supported anymore in such a case.</font>
* </p>
diff --git a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/WordDictionary.java b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/WordDictionary.java
index 073df06573a..c76b1a31fe0 100644
--- a/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/WordDictionary.java
+++ b/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/WordDictionary.java
@@ -37,7 +37,7 @@ import org.apache.lucene.analysis.cn.smart.Utility;
* SmartChineseAnalyzer Word Dictionary
*
* <p><font color="#FF0000">
- * WARNING: The status of the analyzers/smartcn <b>analysis.cn</b> package is experimental.
+ * WARNING: The status of the analyzers/smartcn <b>analysis.cn.smart</b> package is experimental.
* The APIs and file formats introduced here might change in the future and will not be
* supported anymore in such a case.</font>
* </p>
diff --git a/contrib/analyzers/smartcn/src/resources/org/apache/lucene/analysis/cn/stopwords.txt b/contrib/analyzers/smartcn/src/resources/org/apache/lucene/analysis/cn/smart/stopwords.txt
similarity index 100%
rename from contrib/analyzers/smartcn/src/resources/org/apache/lucene/analysis/cn/stopwords.txt
rename to contrib/analyzers/smartcn/src/resources/org/apache/lucene/analysis/cn/smart/stopwords.txt
diff --git a/contrib/analyzers/smartcn/src/test/org/apache/lucene/analysis/cn/TestSmartChineseAnalyzer.java b/contrib/analyzers/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestSmartChineseAnalyzer.java
similarity index 99%
rename from contrib/analyzers/smartcn/src/test/org/apache/lucene/analysis/cn/TestSmartChineseAnalyzer.java
rename to contrib/analyzers/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestSmartChineseAnalyzer.java
index 8fce34a6652..cc4031d29f9 100644
--- a/contrib/analyzers/smartcn/src/test/org/apache/lucene/analysis/cn/TestSmartChineseAnalyzer.java
+++ b/contrib/analyzers/smartcn/src/test/org/apache/lucene/analysis/cn/smart/TestSmartChineseAnalyzer.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.lucene.analysis.cn;
+package org.apache.lucene.analysis.cn.smart;
import java.io.FileNotFoundException;
import java.io.IOException;