我正在使用 simpleNLG 来查找动词的实际时态。但是我似乎做错了,而不是给出动词的时态,而是将其转换为现在时:/
public class TenseWas
{
public static void main(String[] args)
{
String word = "ate";
Lexicon lexicon=Lexicon.getDefaultLexicon();
NLGFactory nlgFactory=new NLGFactory(lexicon);
Realiser realiser=new Realiser(lexicon);
SPhraseSpec p=nlgFactory.createClause();
p.setVerb(word);
if(p.getVerb().getFeature(Feature.TENSE) == (Tense.PAST))
{
System.out.println("past");
}
if(p.getVerb().getFeature(Feature.TENSE) == (Tense.FUTURE))
{
System.out.println("future");
}
if(p.getVerb().getFeature(Feature.TENSE) == (Tense.PRESENT))
{
System.out.println("Present");
}
String output=realiser.realiseSentence(p);
System.out.println(output);
}
}
这是控制台中显示的内容:
吃。