MorphoFeatures morpho = null;
if(baseFormAttr != null && baseFormAttr.getBaseForm() != null){
morpho = new MorphoFeatures(baseFormAttr.getBaseForm());
morpho.addPos(posTag); //and add the posTag
}
InflectionAttribute inflectionAttr = tokenStream.addAttribute(InflectionAttribute.class);
inflectionAttr.getInflectionForm();
inflectionAttr.getInflectionType();
if(morpho != null){ //if present add the morpho
token.addAnnotation(MORPHO_ANNOTATION, Value.value(morpho));
}
}
//we still need to write the last sentence