Lucene.Net.Analysis.Cjk.CJKBigramFilter.FlushBigram C# (CSharp) Method

FlushBigram() private method

Flushes a bigram token to output from our buffer This is the normal case, e.g. ABC -> AB BC
private FlushBigram ( ) : void
return void
        private void FlushBigram()
        {
            ClearAttributes();
            char[] termBuffer = termAtt.ResizeBuffer(4); // maximum bigram length in code units (2 supplementaries)
            int len1 = Character.ToChars(buffer[index], termBuffer, 0);
            int len2 = len1 + Character.ToChars(buffer[index + 1], termBuffer, len1);
            termAtt.Length = len2;
            offsetAtt.SetOffset(startOffset[index], endOffset[index + 1]);
            typeAtt.Type = DOUBLE_TYPE;
            // when outputting unigrams, all bigrams are synonyms that span two unigrams
            if (outputUnigrams)
            {
                posIncAtt.PositionIncrement = 0;
                posLengthAtt.PositionLength = 2;
            }
            index++;
        }