【发布时间】:2016-11-02 01:34:24
【问题描述】:
我是 Simple NLG 的新手,我想获得我输入的动词的动名词。 这是一个示例代码,但我尝试输入动名词来表示时态,但它不起作用
XMLLexicon lexicon = new XMLLexicon("path\\to\\default-lexicon.xml");
WordElement word = lexicon.getWord("live", LexicalCategory.VERB);
InflectedWordElement infl = new InflectedWordElement(word);
infl.setFeature(Feature.TENSE, Tense.PAST); //I want the verb to be in gerund not past
Realiser realiser = new Realiser(lexicon);
String gerund = realiser.realise(infl).getRealisation();
System.out.println(gerund);
【问题讨论】:
-
but it didn't work... 什么不起作用,或者你得到什么输出? -
输出是动词的过去式。因为在第 4 行你可以看到,Tense.PAST 我想将输出更改为动名词,除了没有语法 Tense.GERUND 所以这是我的问题。如何在我的代码中更改这一行或多行,以便输出为动名词。
-
你能检查一下这个文档吗?