Vector vector = new RandomAccessSparseVector(key.toString(), dimension, value.length()); // guess at
// initial size
if (maxNGramSize >= 2) {
ShingleFilter sf = new ShingleFilter(new IteratorTokenStream(value.getEntries().iterator()),
maxNGramSize);
do {
String term = ((TermAttribute) sf.getAttribute(TermAttribute.class)).term();
if (term.length() > 0) { // ngram