/** Resets the attributes */ @Override public void clear() { super.clear(); positionIncrement = positionLength = 1; termFrequency = 1; startOffset = endOffset = 0; type = DEFAULT_TYPE; }
/** Resets the attributes */ @Override public void clear() { super.clear(); positionIncrement = positionLength = 1; termFrequency = 1; startOffset = endOffset = 0; type = DEFAULT_TYPE; }
/** Resets the attributes */ @Override public void clear() { super.clear(); positionIncrement = positionLength = 1; startOffset = endOffset = 0; type = DEFAULT_TYPE; }
/** Resets the term text, payload, flags, and positionIncrement, * startOffset, endOffset and token type to default. */ @Override public void clear() { super.clear(); payload = null; positionIncrement = 1; flags = 0; startOffset = endOffset = 0; type = DEFAULT_TYPE; }
@Override final public boolean incrementToken() throws IOException { IWord word = segmentor.next(); if ( word == null ) { fieldOffset = offsetAtt.endOffset(); /// System.out.println("set fieldOffset=" + fieldOffset); return false; } clearAttributes(); //char[] token = word.getValue().toCharArray(); //termAtt.copyBuffer(token, 0, token.length); termAtt.clear(); termAtt.append(word.getValue()); offsetAtt.setOffset( correctOffset(fieldOffset + word.getPosition()), correctOffset(fieldOffset + word.getPosition() + word.getLength()) ); typeAtt.setType("word"); return true; }