@Override
public String stem(String token) {
tokenizer = new StandardTokenizer(Version.LUCENE_35, new StringReader(token));
TokenStream tokenStream = new ArabicStemFilter(new ArabicNormalizationFilter(tokenizer));
CharTermAttribute termAtt = tokenStream.getAttribute(CharTermAttribute.class);
tokenStream.clearAttributes();
StringBuilder stemmed = new StringBuilder();
try {
while (tokenStream.incrementToken()) {
String curToken = termAtt.toString();
if ( vocab != null && vocab.get(curToken) <= 0) {
continue;
}
stemmed.append( curToken + " " );