else if (feature.equalsIgnoreCase(XML_ID))
word.setId(value);
else if (value == null || value.equals("")) {
// if this is an infl code, add it to inflections
Inflection infl = Inflection.getInflCode(feature);
if (infl != null) {
inflections.add(infl);
} else {
// otherwise assume it's a boolean feature
word.setFeature(feature, true);
}
} else
word.setFeature(feature, value);
}
}
// if no infl specified, assume regular
if (inflections.isEmpty()) {
inflections.add(Inflection.REGULAR);
}
// default inflection code is "reg" if we have it, else random pick form
// infl codes available
Inflection defaultInfl = inflections.contains(Inflection.REGULAR) ? Inflection.REGULAR
: inflections.get(0);
word.setFeature(LexicalFeature.DEFAULT_INFL, defaultInfl);
word.setDefaultInflectionalVariant(defaultInfl);