Ejemplo n.º 1
0
        public void dwightTest()
        {
            // Rachel Dwight's test
            SetupForExternalTest.phraseFactory.setLexicon(SetupForExternalTest.lexicon);

            NPPhraseSpec noun4 = SetupForExternalTest.phraseFactory
                                 .createNounPhrase("FGFR3 gene in every cell");

            noun4.setSpecifier("the");

            PPPhraseSpec prep1 = SetupForExternalTest.phraseFactory.createPrepositionPhrase(
                "of", noun4);

            NPPhraseSpec noun1 = SetupForExternalTest.phraseFactory.createNounPhrase(
                "the", "patient's mother");

            NPPhraseSpec noun2 = SetupForExternalTest.phraseFactory.createNounPhrase(
                "the", "patient's father");

            NPPhraseSpec noun3 = SetupForExternalTest.phraseFactory
                                 .createNounPhrase("changed copy");

            noun3.addPreModifier("one");
            noun3.addComplement(prep1);

            var coordNoun1 = new CoordinatedPhraseElement(
                noun1, noun2);

            coordNoun1.setConjunction("or");

            VPPhraseSpec verbPhrase1 = SetupForExternalTest.phraseFactory.createVerbPhrase("have");

            verbPhrase1.setFeature(Feature.TENSE.ToString(), Tense.PRESENT);

            SPhraseSpec sentence1 = SetupForExternalTest.phraseFactory.createClause(coordNoun1,
                                                                                    verbPhrase1, noun3);

            Assert
            .AreEqual(
                "the patient's mother or the patient's father has one changed copy of the FGFR3 gene in every cell",

                SetupForExternalTest.realiser.realise(sentence1).getRealisation());

            // Rachel's second test
            noun3       = SetupForExternalTest.phraseFactory.createNounPhrase("a", "gene test");
            noun2       = SetupForExternalTest.phraseFactory.createNounPhrase("an", "LDL test");
            noun1       = SetupForExternalTest.phraseFactory.createNounPhrase("the", "clinic");
            verbPhrase1 = SetupForExternalTest.phraseFactory.createVerbPhrase("perform");

            var coord1 = new CoordinatedPhraseElement(noun2,
                                                      noun3);

            sentence1 = SetupForExternalTest.phraseFactory.createClause(noun1, verbPhrase1, coord1);
            sentence1.setFeature(Feature.TENSE.ToString(), Tense.PAST);

            Assert
            .AreEqual(
                "the clinic performed an LDL test and a gene test", SetupForExternalTest.realiser
                .realise(sentence1).getRealisation());
        }