use of org.apache.lucene.analysis.Tokenizer in project lucene-solr by apache.
the class TestPortugueseLightStemFilterFactory method testStemming.
public void testStemming() throws Exception {
Reader reader = new StringReader("evidentemente");
TokenStream stream = new MockTokenizer(MockTokenizer.WHITESPACE, false);
((Tokenizer) stream).setReader(reader);
stream = tokenFilterFactory("PortugueseLightStem").create(stream);
assertTokenStreamContents(stream, new String[] { "evident" });
}
use of org.apache.lucene.analysis.Tokenizer in project lucene-solr by apache.
the class TestPortugueseLightStemFilter method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
analyzer = new Analyzer() {
@Override
protected TokenStreamComponents createComponents(String fieldName) {
Tokenizer source = new MockTokenizer(MockTokenizer.SIMPLE, true);
return new TokenStreamComponents(source, new PortugueseLightStemFilter(source));
}
};
}
use of org.apache.lucene.analysis.Tokenizer in project lucene-solr by apache.
the class TestPortugueseMinimalStemFilter method testEmptyTerm.
public void testEmptyTerm() throws IOException {
Analyzer a = new Analyzer() {
@Override
protected TokenStreamComponents createComponents(String fieldName) {
Tokenizer tokenizer = new KeywordTokenizer();
return new TokenStreamComponents(tokenizer, new PortugueseMinimalStemFilter(tokenizer));
}
};
checkOneTerm(a, "", "");
a.close();
}
use of org.apache.lucene.analysis.Tokenizer in project lucene-solr by apache.
the class TestPortugueseLightStemFilter method testKeyword.
public void testKeyword() throws IOException {
final CharArraySet exclusionSet = new CharArraySet(asSet("quilométricas"), false);
Analyzer a = new Analyzer() {
@Override
protected TokenStreamComponents createComponents(String fieldName) {
Tokenizer source = new MockTokenizer(MockTokenizer.WHITESPACE, false);
TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
return new TokenStreamComponents(source, new PortugueseLightStemFilter(sink));
}
};
checkOneTerm(a, "quilométricas", "quilométricas");
a.close();
}
use of org.apache.lucene.analysis.Tokenizer in project lucene-solr by apache.
the class TestPortugueseMinimalStemFilter method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
analyzer = new Analyzer() {
@Override
protected TokenStreamComponents createComponents(String fieldName) {
Tokenizer source = new MockTokenizer(MockTokenizer.SIMPLE, true);
return new TokenStreamComponents(source, new PortugueseMinimalStemFilter(source));
}
};
}
Aggregations