private List<String> filter(TokenFilter filter) throws IOException { List<String> tas = new ArrayList<>(); CharTermAttribute termAtt = filter.getAttribute(CharTermAttribute.class); filter.reset(); while (filter.incrementToken()) { tas.add(termAtt.toString()); } filter.end(); filter.close(); return tas; }
@Override public void close() throws IOException { super.close(); if (VERBOSE) System.out.println(input.getClass().getSimpleName() + ".close()"); }
public void close() throws IOException { super.close(); tokenQueue.clear(); }