Example usage for org.apache.lucene.analysis.miscellaneous EmptyTokenStream EmptyTokenStream

List of usage examples for org.apache.lucene.analysis.miscellaneous EmptyTokenStream EmptyTokenStream

Introduction

In this page you can find the example usage for org.apache.lucene.analysis.miscellaneous EmptyTokenStream EmptyTokenStream.

Prototype

EmptyTokenStream

Source Link

Usage

From source file:com.bigdata.search.EmptyAnalyzer.java

License:Open Source License

@Override
public TokenStream tokenStream(String arg0, Reader arg1) {
    return new EmptyTokenStream();
}

From source file:com.shaie.annots.filter.AnnotatorTokenFilterTest.java

License:Apache License

@Test
public void returns_false_when_no_more_tokens() throws IOException {
    try (TokenFilter f = new AnnotatorTokenFilter(new EmptyTokenStream(), annotator)) {
        f.reset();//from  w ww  . j a va  2 s  . co m
        assertThat(f.incrementToken()).isFalse();
    }
}

From source file:com.shaie.annots.filter.PreAnnotatedTokenFilterTest.java

License:Apache License

@SuppressWarnings({ "unused", "resource" })
@Test//from ww  w.  j a va2  s  . c o  m
public void fails_if_no_annotation_markers() {
    expected.expect(IllegalArgumentException.class);
    new PreAnnotatedTokenFilter(new EmptyTokenStream());
}

From source file:com.shaie.annots.filter.PreAnnotatedTokenFilterTest.java

License:Apache License

@Test
public void returns_false_when_no_more_tokens() throws IOException {
    try (TokenFilter f = new PreAnnotatedTokenFilter(new EmptyTokenStream(), 1, 2)) {
        f.reset();/*from w ww.  j  ava 2s  .c  o m*/
        assertThat(f.incrementToken()).isFalse();
    }
}

From source file:com.shaie.annots.filter.SimplePreAnnotatedTokenFilterTest.java

License:Apache License

@SuppressWarnings({ "unused", "resource" })
@Test/*from w  w  w.  j a v a2 s  .  co  m*/
public void fails_if_no_annotation_markers() {
    expected.expect(IllegalArgumentException.class);
    new SimplePreAnnotatedTokenFilter(new EmptyTokenStream());
}

From source file:com.shaie.annots.filter.SimplePreAnnotatedTokenFilterTest.java

License:Apache License

@Test
public void returns_false_when_no_more_tokens() throws IOException {
    try (TokenFilter f = new SimplePreAnnotatedTokenFilter(new EmptyTokenStream(), 1, 2)) {
        f.reset();/*from   ww w .j  a va2  s.c  om*/
        assertThat(f.incrementToken()).isFalse();
    }
}

From source file:de.fhg.iais.cortex.search.TermRememberingFormatterTest.java

License:Apache License

@Test
public void testSimpleTest() {
    TermRememberingFormatter formatter = new TermRememberingFormatter(new SimpleHTMLFormatter());
    formatter.clearHighlightedTerms();/*from  w  w  w . j  a v  a 2s. c  o  m*/
    TokenGroup tokenGroup = new TokenGroup(new EmptyTokenStream());
    formatter.highlightTerm("foo bar jelly juice pumpkin", tokenGroup);
    List<String> terms = formatter.getHighlightedTerms();

    Assert.assertTrue(terms.isEmpty());
}

From source file:org.alfresco.repo.search.impl.lucene.analysis.EmptyAnalyser.java

License:Open Source License

/**
 * Constructs a {@link TokenStream} that returns nothing
 *///from w  w w . j  av  a  2  s  . c o m
public TokenStream tokenStream(String fieldName, Reader reader) {
    return new EmptyTokenStream();
}

From source file:uk.co.flax.luwak.presearcher.FieldFilterPresearcherComponent.java

License:Apache License

@Override
public TokenStream filterDocumentTokens(String field, TokenStream ts) {
    // We don't want tokens from this field to be present in the disjunction,
    // only in the extra filter query.  Otherwise, every doc that matches in
    // this field will be selected!
    if (this.field.equals(field))
        return new EmptyTokenStream();
    return ts;//from   w w  w .  j  a v a 2s .c  o m
}

From source file:uk.co.flax.luwak.presearcher.TermsEnumFilter.java

License:Apache License

@Override
public TokenStream filter(String field, TokenStream in) throws IOException {
    Terms terms = reader.fields().terms(field);
    if (terms == null)
        return new EmptyTokenStream();
    return new Filter(in, terms.iterator(null));
}