org.apache.lucene.analysis.miscellaneous.Lucene47WordDelimiterFilter.generatePart C# (CSharp) Метод

generatePart() приватный Метод

Generates a word/number part, updating the appropriate attributes
private generatePart ( bool isSingleWord ) : void
isSingleWord bool {@code true} if the generation is occurring from a single word, {@code false} otherwise
Результат void
	  private void generatePart(bool isSingleWord)
	  {
		clearAttributes();
		termAttribute.copyBuffer(savedBuffer, iterator.current, iterator.end - iterator.current);

		int startOffset = savedStartOffset + iterator.current;
		int endOffset = savedStartOffset + iterator.end;

		if (hasIllegalOffsets)
		{
		  // historically this filter did this regardless for 'isSingleWord', 
		  // but we must do a sanity check:
		  if (isSingleWord && startOffset <= savedEndOffset)
		  {
			offsetAttribute.setOffset(startOffset, savedEndOffset);
		  }
		  else
		  {
			offsetAttribute.setOffset(savedStartOffset, savedEndOffset);
		  }
		}
		else
		{
		  offsetAttribute.setOffset(startOffset, endOffset);
		}
		posIncAttribute.PositionIncrement = position(false);
		typeAttribute.Type = savedType;
	  }