示例#1
0
        public void testTwoPossessiveFeature_PastTense()
        {
            // Create the pronoun 'she'
            var she = this.phraseFactory.createWord("she", new LexicalCategory_PRONOUN());

            // Set possessive on the pronoun to make it 'her'
            she.setFeature(Feature.POSSESSIVE.ToString(), true);

            // Create a noun phrase with the subject lover and the determiner
            // as she
            var herLover = this.phraseFactory.createNounPhrase(she, "lover");

            herLover.setPlural(true);

            // Create the pronoun 'he'
            NLGElement he = this.phraseFactory.createNounPhrase(new LexicalCategory_PRONOUN(), "he");

            he.setPlural(true);

            // Create a clause to say 'they be her lovers'
            var clause = this.phraseFactory.createClause(he, "be", herLover);

            clause.setFeature(Feature.POSSESSIVE.ToString(), true);

            // Add the cue phrase need the comma as orthography
            // currently doesn't handle this.
            // This could be expanded to be a noun phrase with determiner
            // 'two' and noun 'week', set to plural and with a premodifier of
            // 'after'
            clause.setFeature(Feature.CUE_PHRASE.ToString(), "after two weeks,");

            // Add the 'for a fortnight' as a post modifier. Alternatively
            // this could be added as a prepositional phrase 'for' with a
            // complement of a noun phrase ('a' 'fortnight')
            clause.addPostModifier("for a fortnight");

            // Set 'be' to 'was' as past tense
            clause.setFeature(Feature.TENSE.ToString(), Tense.PAST);

            // Add the clause to a sentence.
            var sentence1 = this.phraseFactory.createSentence(clause);

            // Realise the sentence
            var realised = this.realiser.realise(sentence1);

            Assert.AreEqual("After two weeks, they were her lovers for a fortnight.",
                            realised.getRealisation());
        }