@Override public final void end() throws IOException { super.end(); }
@Override public void end() throws IOException { super.end(); posIncrAtt.setPositionIncrement(posIncrAtt.getPositionIncrement() + skippedPositions); } }
@Override public void end() throws IOException { super.end(); posIncrAtt.setPositionIncrement(curPosIncr); } }
@Override public void end() throws IOException { super.end(); fixOffsets(); }
@Override public void end() throws IOException { if (!exhausted) { super.end(); } else { restoreState(endState); } }
@Override public void end() throws IOException { super.end(); posIncrAtt.setPositionIncrement(curPosIncr); } }
@Override public void end() throws IOException { if (done == false) { super.end(); } else { // NOTE, shady: don't call super.end, because we did already from incrementToken } clearAttributes(); if (done) { // On exc, done is false, and we will not have set these: posIncAtt.setPositionIncrement(finalPosInc); offsetAtt.setOffset(finalOffset, finalOffset); } else { super.end(); } }
@Override public final void end() throws IOException { super.end(); cachedStates.setFinalState(captureState()); }
@Override public void end() throws IOException { if (endState == null) { super.end(); endState = captureState(); } else { restoreState(endState); } endOffset = getAttribute(OffsetAttribute.class).endOffset(); if (lastTokenFiltered) { this.delegate.end(); endState = captureState(); } }
@Override public final void end() throws IOException { super.end(); }
@Override public final void end() throws IOException { // set final offset super.end(); }
@Override public void end() throws IOException { if (!exhausted) { super.end(); } else { restoreState(endState); } }
@Override public void end() throws IOException { super.end(); resetState(); }
@Override public void end() throws IOException { super.end(); posIncrAtt.setPositionIncrement(posIncrAtt.getPositionIncrement() + skippedPositions); } }
@Override public final void end() throws IOException { super.end(); cachedStates.setFinalState(captureState()); }
@Override public void end() throws IOException { super.end(); posIncrAtt.setPositionIncrement(posIncrAtt.getPositionIncrement() + skippedPositions); } }
ngrams.add(token); sf.end(); sf.close(); } catch (IOException ex) {
private void assertURLDecodedTo(final Tokenizer t, final String uri, final String[] expectedStems, final String[] expectedTypes, final int[] expectedPosIncr) throws IOException { assertTrue("has CharTermAttribute", t.hasAttribute(CharTermAttribute.class)); final CharTermAttribute termAtt = t.getAttribute(CharTermAttribute.class); assertTrue("has TypeAttribute", t.hasAttribute(TypeAttribute.class)); final TypeAttribute typeAtt = t.getAttribute(TypeAttribute.class); assertTrue("has PositionIncrementAttribute", t.hasAttribute(PositionIncrementAttribute.class)); final PositionIncrementAttribute posIncrAtt = t.getAttribute(PositionIncrementAttribute.class); t.setReader(new StringReader(uri)); t.reset(); final TokenFilter filter = new MailtoFilter(t); for (int i = 0; i < expectedStems.length; i++) { assertTrue("token " + i + " exists", filter.incrementToken()); assertEquals(expectedStems[i], termAtt.toString()); if (expectedTypes == null) assertEquals(uritype, typeAtt.type()); else assertEquals(expectedTypes[i], typeAtt.type()); if (expectedPosIncr != null) assertEquals(expectedPosIncr[i], posIncrAtt.getPositionIncrement()); } filter.end(); filter.close(); }
private void assertURLDecodedTo(final Tokenizer t, final String uri, final String[] expectedStems, final String[] expectedTypes, final int[] expectedPosIncr) throws IOException { assertTrue("has CharTermAttribute", t.hasAttribute(CharTermAttribute.class)); final CharTermAttribute termAtt = t.getAttribute(CharTermAttribute.class); assertTrue("has TypeAttribute", t.hasAttribute(TypeAttribute.class)); final TypeAttribute typeAtt = t.getAttribute(TypeAttribute.class); assertTrue("has PositionIncrementAttribute", t.hasAttribute(PositionIncrementAttribute.class)); final PositionIncrementAttribute posIncrAtt = t.getAttribute(PositionIncrementAttribute.class); t.setReader(new StringReader(uri)); t.reset(); final TokenFilter filter = new MailtoFilter(t); for (int i = 0; i < expectedStems.length; i++) { assertTrue("token " + i + " exists", filter.incrementToken()); assertEquals(expectedStems[i], termAtt.toString()); if (expectedTypes == null) assertEquals(uritype, typeAtt.type()); else assertEquals(expectedTypes[i], typeAtt.type()); if (expectedPosIncr != null) assertEquals(expectedPosIncr[i], posIncrAtt.getPositionIncrement()); } filter.end(); filter.close(); }