【问题标题】:How to get subject pronoun with SimpleNLG?如何使用 SimpleNLG 获得主语代词?
【发布时间】:2022-01-08 17:21:44
【问题描述】:
val lexicon: Lexicon = Lexicon.getDefaultLexicon()
val realised: Realiser = Realiser(lexicon)
val word: WordElement = lexicon.getWord("I", LexicalCategory.PRONOUN)
val inflected = InflectedWordElement(word)
inflected.setFeature(Feature.PERSON, Person.THIRD)
inflected.setFeature(Feature.NUMBER, NumberAgreement.PLURAL)
realised.realise(inflected).realisation

我想得到“他们”,但我得到了“他们”。我试图找到一些特征“SUBJECT”或“OBJECT”,但我只找到了“POSSESIVE”和“REFLEXIVE”。我怎样才能澄清我的条件只根据主语代词?

【问题讨论】:

    标签: kotlin nlg simplenlg


    【解决方案1】:
    inflected.setFeature(
        InternalFeature.DISCOURSE_FUNCTION,
        DiscourseFunction.SUBJECT
    )
    

    最后一个字符串之前的这个字符串解决了我的问题。不幸的是,文档没有包含它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多