您如何获得动词的过去式?

您如何获得动词的过去式?,第1张

您如何获得动词的过去式?

虽然我想通过算法来执行此 *** 作而不使用字典,但我不得不诉诸于使用字典。

我发现最高效的库是SimpleNLG。

由于他们的文档与当前API不同步,因此以下是实现此目的的方法:

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);Realiser realiser = new Realiser(lexicon);String past = realiser.realise(infl).getRealisation();System.out.println(past);


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5498497.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-13
下一篇 2022-12-13

发表评论

登录后才能评论

评论列表(0条)

保存