SimpleNLG: how we specify the quantity?

Viewed 497

My question is how to specify the quantity in a noun phrase? For example:

NPPhraseSpec np = nlgFactory.createNounPhrase("", "apple");

How to generate "5 apples", for example? A solution is to put a preModifier, the code would be:

    Lexicon lexicon = Lexicon.getDefaultLexicon();
    NLGFactory nlgFactory = new NLGFactory(lexicon);
    Realiser realiser = new Realiser();
    NPPhraseSpec np = nlgFactory.createNounPhrase("", "apple");
    np.addPreModifier("5");
    np.setPlural(true);
    System.out.println(realiser.realiseSentence(np));

But, isn't there another solution which handles the numbers and put the noun to plural automatically?

1 Answers
Related