Beispiel #1
0
 public override bool IncrementToken()
 {
     if (input.IncrementToken())
     {
         char[] buffer = termAtt.TermBuffer();
         int    length = termAtt.TermLength();
         // If no characters actually require rewriting then we
         // just return token as-is:
         for (int i = 0; i < length; i++)
         {
             char c = buffer[i];
             if (c >= '\u00c0' && c <= '\uFB06')
             {
                 RemoveAccents(buffer, length);
                 termAtt.SetTermBuffer(output, 0, outputPos);
                 break;
             }
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
 public override bool IncrementToken()
 {
     num--;
     if (num >= 0)
     {
         ClearAttributes();
         termAtt.SetTermBuffer(value_Renamed);
         return(true);
     }
     return(false);
 }
Beispiel #3
0
 public override bool IncrementToken()
 {
     if (!first)
     {
         return(false);
     }
     first = false;
     ClearAttributes();
     termAtt.SetTermBuffer(term);
     payloadAtt.SetPayload(new Payload(payload));
     return(true);
 }
Beispiel #4
0
 public override bool IncrementToken()
 {
     if (index == tokens.Length)
     {
         return(false);
     }
     else
     {
         ClearAttributes();
         termAtt.SetTermBuffer(tokens[index++]);
         return(true);
     }
 }
Beispiel #5
0
        public override bool IncrementToken()
        {
            if (!input.IncrementToken())
            {
                return(false);
            }

            if (stemmer.Stem(termAtt.TermBuffer(), 0, termAtt.TermLength()))
            {
                termAtt.SetTermBuffer(stemmer.GetResultBuffer(), 0, stemmer.GetResultLength());
            }
            return(true);
        }
Beispiel #6
0
 public override bool IncrementToken()
 {
     if (i == TOKENS.Length)
     {
         return(false);
     }
     ClearAttributes();
     termAtt.SetTermBuffer(TOKENS[i]);
     offsetAtt.SetOffset(i, i);
     posIncrAtt.SetPositionIncrement(INCREMENTS[i]);
     i++;
     return(true);
 }
 public override bool IncrementToken()
 {
     if (index == Enclosing_Instance.tokens.Length)
     {
         return(false);
     }
     else
     {
         ClearAttributes();
         termAtt.SetTermBuffer(Enclosing_Instance.tokens[index++]);
         offsetAtt.SetOffset(0, 0);
         return(true);
     }
 }
 public override bool IncrementToken()
 {
     if (Lucene.Net.QueryParsers.TestMultiAnalyzer.multiToken > 0)
     {
         termAtt.SetTermBuffer("multi" + (Lucene.Net.QueryParsers.TestMultiAnalyzer.multiToken + 1));
         offsetAtt.SetOffset(prevStartOffset, prevEndOffset);
         typeAtt.SetType(prevType);
         posIncrAtt.SetPositionIncrement(0);
         Lucene.Net.QueryParsers.TestMultiAnalyzer.multiToken--;
         return(true);
     }
     else
     {
         bool next = input.IncrementToken();
         if (next == false)
         {
             return(false);
         }
         prevType        = typeAtt.Type();
         prevStartOffset = offsetAtt.StartOffset();
         prevEndOffset   = offsetAtt.EndOffset();
         System.String text = termAtt.Term();
         if (text.Equals("triplemulti"))
         {
             Lucene.Net.QueryParsers.TestMultiAnalyzer.multiToken = 2;
             return(true);
         }
         else if (text.Equals("multi"))
         {
             Lucene.Net.QueryParsers.TestMultiAnalyzer.multiToken = 1;
             return(true);
         }
         else
         {
             return(true);
         }
     }
 }
 public override bool IncrementToken()
 {
     if (tokenUpto >= Enclosing_Instance.tokens.Length)
     {
         return(false);
     }
     else
     {
         TestToken testToken = Enclosing_Instance.tokens[tokenUpto++];
         ClearAttributes();
         termAtt.SetTermBuffer(testToken.text);
         offsetAtt.SetOffset(testToken.startOffset, testToken.endOffset);
         if (tokenUpto > 1)
         {
             posIncrAtt.SetPositionIncrement(testToken.pos - Enclosing_Instance.tokens[tokenUpto - 2].pos);
         }
         else
         {
             posIncrAtt.SetPositionIncrement(testToken.pos + 1);
         }
         return(true);
     }
 }
 public void  Reinit(System.String stringValue, int startOffset, int endOffset)
 {
     termAttribute.SetTermBuffer(stringValue);
     offsetAttribute.SetOffset(startOffset, endOffset);
 }
 /// <summary> Fills TermAttribute with the current token text.</summary>
 internal void  GetText(TermAttribute t)
 {
     t.SetTermBuffer(zzBuffer, zzStartRead, zzMarkedPos - zzStartRead);
 }
		/// <summary> Fills TermAttribute with the current token text.</summary>
		internal void  GetText(TermAttribute t)
		{
			t.SetTermBuffer(zzBuffer, zzStartRead, zzMarkedPos - zzStartRead);
		}