while (ts.incrementToken()) {
Object row = app.create("item");
app.setString(row, "text", ((CharTermAttribute)ts.getAttribute(CharTermAttribute.class)).toString());
app.add(resultsList, row);
app.putProperty(row, "state", ts.cloneAttributes());
}
ts.close();
} catch (Throwable t) {
app.showStatus("Error analyzing:" + t.getMessage());
}