Skip to content

Apache Lucene open-source search software

lucene 2.4-dev r688745

Yonik Seeleyc22010a1c3f2
diff --git a/CHANGES.txt b/CHANGES.txt
index 4085325180f..64fc7bf1bfc 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -614,6 +614,7 @@ Other Changes
23. SOLR-692: Migrated to stable released builds of StAX API 1.0.1 and StAX 1.2.0 (shalin)
24. Upgraded to Lucene 2.4-dev (r686801) (yonik)
+24. Upgraded to Lucene 2.4-dev (r688745) 27-Aug-2008 (yonik)
Build
1. SOLR-411. Changed the names of the Solr JARs to use the defacto standard JAR names based on
diff --git a/lib/lucene-analyzers-2.4-dev.jar b/lib/lucene-analyzers-2.4-dev.jar
index bc564e040e6..e6fc2fede15 100644
--- a/lib/lucene-analyzers-2.4-dev.jar
+++ b/lib/lucene-analyzers-2.4-dev.jar
@@ -1,2 +1,2 @@
-AnyObjectId[21285828e9eedf3b37e52f40dbd50f6e02550e58] was removed in git history.
+AnyObjectId[a297b74977020019fe7ac607df2e8ec573944e9c] was removed in git history.
Apache SVN contains full history.
\ No newline at end of file
diff --git a/lib/lucene-core-2.4-dev.jar b/lib/lucene-core-2.4-dev.jar
index 3cac9d13b9b..3bc8838ad08 100644
--- a/lib/lucene-core-2.4-dev.jar
+++ b/lib/lucene-core-2.4-dev.jar
@@ -1,2 +1,2 @@
-AnyObjectId[a01a0a819db377c8ef1c8c7ec1c2e339c84aa83b] was removed in git history.
+AnyObjectId[596625b0a1fdfb00581cabc31eac3fd7dbbe86a7] was removed in git history.
Apache SVN contains full history.
\ No newline at end of file
diff --git a/lib/lucene-highlighter-2.4-dev.jar b/lib/lucene-highlighter-2.4-dev.jar
index a9e5e792903..3c66f426fdc 100644
--- a/lib/lucene-highlighter-2.4-dev.jar
+++ b/lib/lucene-highlighter-2.4-dev.jar
@@ -1,2 +1,2 @@
-AnyObjectId[51896ad69d2555a5617ccf10a01e108587a8a3cc] was removed in git history.
+AnyObjectId[db13718008ec899c69ebf640ae649b58135b062b] was removed in git history.
Apache SVN contains full history.
\ No newline at end of file
diff --git a/lib/lucene-memory-2.4-dev.jar b/lib/lucene-memory-2.4-dev.jar
index ec445125f50..0469f9a1b20 100644
--- a/lib/lucene-memory-2.4-dev.jar
+++ b/lib/lucene-memory-2.4-dev.jar
@@ -1,2 +1,2 @@
-AnyObjectId[eb33a0409a51a0851d12f5c67cd36cdb46549950] was removed in git history.
+AnyObjectId[50c8cb42b852c394331912a1b325f5284f0de099] was removed in git history.
Apache SVN contains full history.
\ No newline at end of file
diff --git a/lib/lucene-queries-2.4-dev.jar b/lib/lucene-queries-2.4-dev.jar
index 651a9e96c90..98e20729cbd 100644
--- a/lib/lucene-queries-2.4-dev.jar
+++ b/lib/lucene-queries-2.4-dev.jar
@@ -1,2 +1,2 @@
-AnyObjectId[80795011a13631dc55cf066092be1808ea5b28bd] was removed in git history.
+AnyObjectId[aef3fb8813eba25eb578dd494e29088df70ff466] was removed in git history.
Apache SVN contains full history.
\ No newline at end of file
diff --git a/lib/lucene-snowball-2.4-dev.jar b/lib/lucene-snowball-2.4-dev.jar
index 87dafe59e91..db3fc62a719 100644
--- a/lib/lucene-snowball-2.4-dev.jar
+++ b/lib/lucene-snowball-2.4-dev.jar
@@ -1,2 +1,2 @@
-AnyObjectId[098ccf5c3e15a3202d6e39cb35e01472916ebc3f] was removed in git history.
+AnyObjectId[1c733b90279fb1e1911f35f0459220470a9c0307] was removed in git history.
Apache SVN contains full history.
\ No newline at end of file
diff --git a/lib/lucene-spellchecker-2.4-dev.jar b/lib/lucene-spellchecker-2.4-dev.jar
index f3123e3eb57..31db2953ba6 100644
--- a/lib/lucene-spellchecker-2.4-dev.jar
+++ b/lib/lucene-spellchecker-2.4-dev.jar
@@ -1,2 +1,2 @@
-AnyObjectId[5a7f760a8495cc7bf36303e0c75aba876fe8b68d] was removed in git history.
+AnyObjectId[0195fa2b64ba96a234fec689e0d54fd4ed10bc97] was removed in git history.
Apache SVN contains full history.
\ No newline at end of file
diff --git a/src/java/org/apache/solr/analysis/EnglishPorterFilterFactory.java b/src/java/org/apache/solr/analysis/EnglishPorterFilterFactory.java
index ee9e9c98a4b..9f1a57a59c0 100644
--- a/src/java/org/apache/solr/analysis/EnglishPorterFilterFactory.java
+++ b/src/java/org/apache/solr/analysis/EnglishPorterFilterFactory.java
@@ -75,12 +75,12 @@ public class EnglishPorterFilterFactory extends BaseTokenFilterFactory implement
*/
class EnglishPorterFilter extends TokenFilter {
private final CharArraySet protWords;
- private net.sf.snowball.ext.EnglishStemmer stemmer;
+ private org.tartarus.snowball.ext.EnglishStemmer stemmer;
public EnglishPorterFilter(TokenStream source, CharArraySet protWords) {
super(source);
this.protWords = protWords;
- stemmer = new net.sf.snowball.ext.EnglishStemmer();
+ stemmer = new org.tartarus.snowball.ext.EnglishStemmer();
}
diff --git a/src/java/org/apache/solr/analysis/SnowballPorterFilterFactory.java b/src/java/org/apache/solr/analysis/SnowballPorterFilterFactory.java
index c8474a849e3..16aa3f648c8 100644
--- a/src/java/org/apache/solr/analysis/SnowballPorterFilterFactory.java
+++ b/src/java/org/apache/solr/analysis/SnowballPorterFilterFactory.java
@@ -20,6 +20,7 @@ import java.util.Map;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.snowball.SnowballFilter;
+import org.tartarus.snowball.SnowballProgram;
/**
* Factory for SnowballFilters, with configurable language
@@ -31,16 +32,29 @@ import org.apache.lucene.analysis.snowball.SnowballFilter;
*/
public class SnowballPorterFilterFactory extends BaseTokenFilterFactory {
private String language = "English";
-
+ private Class stemClass;
+
@Override
public void init(Map<String, String> args) {
super.init(args);
final String cfgLanguage = args.get("language");
if(cfgLanguage!=null) language = cfgLanguage;
+
+ try {
+ stemClass = Class.forName("org.tartarus.snowball.ext." + language + "Stemmer");
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException("Can't find class for stemmer language " + language, e);
+ }
}
public SnowballFilter create(TokenStream input) {
- return new SnowballFilter(input,language);
+ SnowballProgram program;
+ try {
+ program = (SnowballProgram)stemClass.newInstance();
+ } catch (Exception e) {
+ throw new RuntimeException("Error instantiating stemmer for language " + language + "from class " +stemClass, e);
+ }
+ return new SnowballFilter(input, program);
}
}
diff --git a/src/test/org/apache/solr/analysis/EnglishPorterFilterFactoryTest.java b/src/test/org/apache/solr/analysis/EnglishPorterFilterFactoryTest.java
index da6407596d2..cdc067a0c99 100644
--- a/src/test/org/apache/solr/analysis/EnglishPorterFilterFactoryTest.java
+++ b/src/test/org/apache/solr/analysis/EnglishPorterFilterFactoryTest.java
@@ -16,8 +16,8 @@ package org.apache.solr.analysis;
* limitations under the License.
*/
-import net.sf.snowball.ext.EnglishStemmer;
import org.apache.solr.common.ResourceLoader;
+import org.tartarus.snowball.ext.EnglishStemmer;
import java.io.IOException;
import java.io.InputStream;
@@ -30,7 +30,7 @@ import java.util.Collections;
public class EnglishPorterFilterFactoryTest extends BaseTokenTestCase {
public void test() throws IOException {
- EnglishStemmer stemmer = new net.sf.snowball.ext.EnglishStemmer();
+ EnglishStemmer stemmer = new EnglishStemmer();
String[] test = {"The", "fledgling", "banks", "were", "counting", "on", "a", "big", "boom", "in", "banking"};
StringBuilder gold = new StringBuilder();
for (int i = 0; i < test.length; i++) {
@@ -49,7 +49,7 @@ public class EnglishPorterFilterFactoryTest extends BaseTokenTestCase {
}
public void testProtected() throws Exception {
- EnglishStemmer stemmer = new net.sf.snowball.ext.EnglishStemmer();
+ EnglishStemmer stemmer = new EnglishStemmer();
String[] test = {"The", "fledgling", "banks", "were", "counting", "on", "a", "big", "boom", "in", "banking"};
StringBuilder gold = new StringBuilder();
for (int i = 0; i < test.length; i++) {