Package org.apache.lucene.analysis

Examples of org.apache.lucene.analysis.SinkTokenizer


    ir.close();
  }

  // LUCENE-1255
  public void testNegativePositions() throws Throwable {
    SinkTokenizer tokens = new SinkTokenizer();
    Token t = new Token();
    t.setTermText("a");
    t.setPositionIncrement(0);
    tokens.add(t);
    t.setTermText("b");
    t.setPositionIncrement(1);
    tokens.add(t);
    t.setTermText("c");
    tokens.add(t);

    MockRAMDirectory dir = new MockRAMDirectory();
    IndexWriter w = new IndexWriter(dir, false, new WhitespaceAnalyzer(), true);
    Document doc = new Document();
    doc.add(new Field("field", tokens));
View Full Code Here


    }
  }

  // LUCENE-1255
  public void testNegativePositions() throws Throwable {
    SinkTokenizer tokens = new SinkTokenizer();
    Token t = new Token();
    t.setTermBuffer("a");
    t.setPositionIncrement(0);
    tokens.add(t);
    t.setTermBuffer("b");
    t.setPositionIncrement(1);
    tokens.add(t);
    t.setTermBuffer("c");
    tokens.add(t);

    MockRAMDirectory dir = new MockRAMDirectory();
    IndexWriter w = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.UNLIMITED);
    Document doc = new Document();
    doc.add(new Field("field", tokens));
View Full Code Here

    }
  }

  // LUCENE-1255
  public void testNegativePositions() throws Throwable {
    SinkTokenizer tokens = new SinkTokenizer();
    Token t = new Token();
    t.setTermBuffer("a");
    t.setPositionIncrement(0);
    tokens.add(t);
    t.setTermBuffer("b");
    t.setPositionIncrement(1);
    tokens.add(t);
    t.setTermBuffer("c");
    tokens.add(t);

    MockRAMDirectory dir = new MockRAMDirectory();
    IndexWriter w = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.UNLIMITED);
    Document doc = new Document();
    doc.add(new Field("field", tokens));
View Full Code Here

TOP

Related Classes of org.apache.lucene.analysis.SinkTokenizer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.