LUCENE-2031: Move patternanalyzer from memory contrib into analyzers

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@832889 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2009-11-04 22:37:01 +00:00
parent e69b4d43f6
commit 80e8bfbbc9
5 changed files with 10 additions and 11 deletions

View File

@ -96,7 +96,10 @@ Build
* LUCENE-1904: Moved wordnet-based synonym support from contrib/memory
into contrib/wordnet. (Robert Muir)
* LUCENE-2031: Moved PatternAnalyzer from contrib/memory into
contrib/analyzers/common, under miscellaneous. (Robert Muir)
Test Cases
======================= Release 2.9.0 2009-09-23 =======================

View File

@ -1,4 +1,4 @@
package org.apache.lucene.index.memory;
package org.apache.lucene.analysis.miscellaneous;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more

View File

@ -1,4 +1,4 @@
package org.apache.lucene.index.memory;
package org.apache.lucene.analysis.miscellaneous;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more

View File

@ -19,6 +19,7 @@ package org.apache.lucene.index.memory;
import java.io.IOException;
import java.io.Serializable;
import java.io.StringReader;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
@ -249,13 +250,9 @@ public class MemoryIndex implements Serializable {
if (analyzer == null)
throw new IllegalArgumentException("analyzer must not be null");
TokenStream stream;
if (analyzer instanceof PatternAnalyzer) {
stream = ((PatternAnalyzer) analyzer).tokenStream(fieldName, text);
} else {
stream = analyzer.tokenStream(fieldName,
new PatternAnalyzer.FastStringReader(text));
}
TokenStream stream = analyzer.tokenStream(fieldName,
new StringReader(text));
addField(fieldName, stream);
}

View File

@ -280,7 +280,6 @@ public class MemoryIndexTest extends BaseTokenStreamTestCase {
new SimpleAnalyzer(),
new StopAnalyzer(Version.LUCENE_CURRENT),
new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT),
PatternAnalyzer.DEFAULT_ANALYZER,
// new WhitespaceAnalyzer(),
// new PatternAnalyzer(PatternAnalyzer.NON_WORD_PATTERN, false, null),
// new PatternAnalyzer(PatternAnalyzer.NON_WORD_PATTERN, true, stopWords),