Examples of termLength()


Examples of org.apache.lucene.analysis.Token.termLength()

          // shorter
          // to avoid problems with genitive 's characters and other binding
          // characters
          if (this.onlyLongestMatch) {
            if (longestMatchToken != null) {
              if (longestMatchToken.termLength() < partLength - 1) {
                longestMatchToken = createToken(start, partLength - 1, token);
              }
            } else {
              longestMatchToken = createToken(start, partLength - 1, token);
            }
View Full Code Here

Examples of org.apache.lucene.analysis.Token.termLength()

                        {
                           Fieldable field = fields[k];
                           // assume properties fields use
                           // SingleTokenStream
                           t = field.tokenStreamValue().next(t);
                           String value = new String(t.termBuffer(), 0, t.termLength());
                           if (value.startsWith(namePrefix))
                           {
                              // extract value
                              value = value.substring(namePrefix.length());
                              // create new named value
View Full Code Here

Examples of org.apache.lucene.analysis.Token.termLength()

                        {
                           Fieldable field = fields[k];
                           // assume properties fields use
                           // SingleTokenStream
                           t = field.tokenStreamValue().next(t);
                           String value = new String(t.termBuffer(), 0, t.termLength());
                           if (value.startsWith(namePrefix))
                           {
                              // extract value
                              value = value.substring(namePrefix.length());
                              // create new named value
View Full Code Here

Examples of org.apache.lucene.analysis.Token.termLength()

                        {
                           Fieldable field = fields[k];
                           // assume properties fields use
                           // SingleTokenStream
                           t = field.tokenStreamValue().next(t);
                           String value = new String(t.termBuffer(), 0, t.termLength());
                           if (value.startsWith(namePrefix))
                           {
                              // extract value
                              value = value.substring(namePrefix.length());
                              // create new named value
View Full Code Here

Examples of org.apache.lucene.analysis.Token.termLength()

    do {
      token = produceNextToken(reusableToken);
    } while (token == request_next_token);
    if (token == null) return false;
   
    termAtt.setTermBuffer(token.termBuffer(), 0, token.termLength());
    posIncrAtt.setPositionIncrement(token.getPositionIncrement());
    flagsAtt.setFlags(token.getFlags());
    offsetAtt.setOffset(token.startOffset(), token.endOffset());
    typeAtt.setType(token.type());
    payloadAtt.setPayload(token.getPayload());
View Full Code Here

Examples of org.apache.lucene.analysis.Token.termLength()

        List shingle = new ArrayList();

        for (int i = 0; i < currentShingleLength; i++) {
          Token shingleToken = (Token) currentPermuationTokens.get(i + currentPermutationTokensStartOffset);
          termLength += shingleToken.termLength();
          shingle.add(shingleToken);
        }
        if (spacerCharacter != null) {
          termLength += currentShingleLength - 1;
        }
View Full Code Here

Examples of org.apache.lucene.analysis.Token.termLength()

        for (Iterator iterator = shingle.iterator(); iterator.hasNext();) {
          Token shingleToken = (Token) iterator.next();
          if (spacerCharacter != null && sb.length() > 0) {
            sb.append(spacerCharacter);
          }
          sb.append(shingleToken.termBuffer(), 0, shingleToken.termLength());
        }
        reusableToken.setTermBuffer(sb.toString());
        updateToken(reusableToken, shingle, currentPermutationTokensStartOffset, currentPermutationRows, currentPermuationTokens);

        return reusableToken;
View Full Code Here

Examples of org.apache.lucene.analysis.Token.termLength()

    @Override
    public final boolean incrementToken() throws IOException {
      clearAttributes();
      if (index < testToken.length) {
        Token t = testToken[index++];
        termAtt.setTermBuffer(t.termBuffer(), 0, t.termLength());
        offsetAtt.setOffset(t.startOffset(), t.endOffset());
        posIncrAtt.setPositionIncrement(t.getPositionIncrement());
        typeAtt.setType(TypeAttributeImpl.DEFAULT_TYPE);
        return true;
      } else {
View Full Code Here

Examples of org.apache.lucene.analysis.Token.termLength()

{
  public static String tsToString(TokenStream in) throws IOException {
    StringBuilder out = new StringBuilder();
    Token t = in.next();
    if (null != t)
      out.append(new String(t.termBuffer(), 0, t.termLength()));
   
    for (t = in.next(); null != t; t = in.next()) {
      out.append(" ").append(new String(t.termBuffer(), 0, t.termLength()));
    }
    in.close();
View Full Code Here

Examples of org.apache.lucene.analysis.Token.termLength()

    Token t = in.next();
    if (null != t)
      out.append(new String(t.termBuffer(), 0, t.termLength()));
   
    for (t = in.next(); null != t; t = in.next()) {
      out.append(" ").append(new String(t.termBuffer(), 0, t.termLength()));
    }
    in.close();
    return out.toString();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.