mirror of https://github.com/apache/lucene.git
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:
parent
e69b4d43f6
commit
80e8bfbbc9
|
@ -97,6 +97,9 @@ Build
|
||||||
* LUCENE-1904: Moved wordnet-based synonym support from contrib/memory
|
* LUCENE-1904: Moved wordnet-based synonym support from contrib/memory
|
||||||
into contrib/wordnet. (Robert Muir)
|
into contrib/wordnet. (Robert Muir)
|
||||||
|
|
||||||
|
* LUCENE-2031: Moved PatternAnalyzer from contrib/memory into
|
||||||
|
contrib/analyzers/common, under miscellaneous. (Robert Muir)
|
||||||
|
|
||||||
Test Cases
|
Test Cases
|
||||||
======================= Release 2.9.0 2009-09-23 =======================
|
======================= Release 2.9.0 2009-09-23 =======================
|
||||||
|
|
||||||
|
|
|
@ -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
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
@ -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
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
@ -19,6 +19,7 @@ package org.apache.lucene.index.memory;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.io.StringReader;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -249,13 +250,9 @@ public class MemoryIndex implements Serializable {
|
||||||
if (analyzer == null)
|
if (analyzer == null)
|
||||||
throw new IllegalArgumentException("analyzer must not be null");
|
throw new IllegalArgumentException("analyzer must not be null");
|
||||||
|
|
||||||
TokenStream stream;
|
TokenStream stream = analyzer.tokenStream(fieldName,
|
||||||
if (analyzer instanceof PatternAnalyzer) {
|
new StringReader(text));
|
||||||
stream = ((PatternAnalyzer) analyzer).tokenStream(fieldName, text);
|
|
||||||
} else {
|
|
||||||
stream = analyzer.tokenStream(fieldName,
|
|
||||||
new PatternAnalyzer.FastStringReader(text));
|
|
||||||
}
|
|
||||||
addField(fieldName, stream);
|
addField(fieldName, stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -280,7 +280,6 @@ public class MemoryIndexTest extends BaseTokenStreamTestCase {
|
||||||
new SimpleAnalyzer(),
|
new SimpleAnalyzer(),
|
||||||
new StopAnalyzer(Version.LUCENE_CURRENT),
|
new StopAnalyzer(Version.LUCENE_CURRENT),
|
||||||
new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT),
|
new StandardAnalyzer(org.apache.lucene.util.Version.LUCENE_CURRENT),
|
||||||
PatternAnalyzer.DEFAULT_ANALYZER,
|
|
||||||
// new WhitespaceAnalyzer(),
|
// new WhitespaceAnalyzer(),
|
||||||
// new PatternAnalyzer(PatternAnalyzer.NON_WORD_PATTERN, false, null),
|
// new PatternAnalyzer(PatternAnalyzer.NON_WORD_PATTERN, false, null),
|
||||||
// new PatternAnalyzer(PatternAnalyzer.NON_WORD_PATTERN, true, stopWords),
|
// new PatternAnalyzer(PatternAnalyzer.NON_WORD_PATTERN, true, stopWords),
|
||||||
|
|
Loading…
Reference in New Issue