String baseForm = record.GetBase();
LexicalCategory category = getSimplenlgCategory(record);
String id = record.GetEui();
// create word class
WordElement wordElement = new WordElement(baseForm, category, id);
// now add type information
switch (category) {
case ADJECTIVE:
addAdjectiveInfo(wordElement, record.GetCatEntry().GetAdjEntry());
break;
case ADVERB:
addAdverbInfo(wordElement, record.GetCatEntry().GetAdvEntry());
break;
case NOUN:
addNounInfo(wordElement, record.GetCatEntry().GetNounEntry());
break;
case VERB:
addVerbInfo(wordElement, record.GetCatEntry().GetVerbEntry());
break;
// ignore closed class words
}
Inflection defaultInfl = (Inflection) wordElement
.getDefaultInflectionalVariant();
// now add inflected forms
// if (keepStandardInflections || !standardInflections(record,
// category)) {
for (InflVar inflection : record.GetInflVarsAndAgreements()
.GetInflValues()) {
String simplenlgInflection = getSimplenlgInflection(inflection
.GetInflection());
if (simplenlgInflection != null) {
String inflectedForm = inflection.GetVar();
Inflection inflType = Inflection.getInflCode(inflection
.GetType());
// store all inflectional variants, except for regular ones
// unless explicitly set
if (inflType != null
&& !(Inflection.REGULAR.equals(inflType) && !this.keepStandardInflections)) {
wordElement.addInflectionalVariant(inflType,
simplenlgInflection, inflectedForm);
}
// if the infl variant is the default, also set this feature on
// the word
if (defaultInfl == null
|| (defaultInfl.equals(inflType) && !(Inflection.REGULAR
.equals(inflType) && !this.keepStandardInflections))) {
wordElement.setFeature(simplenlgInflection, inflectedForm);
}
// wordElement
// .setFeature(simplenlgInflection, inflection.GetVar());
}