Exemplo n.º 1
0
        /**
         * Realises a phrase element.
         *
         * @param phrase
         *            the element to be realised
         * @return the realised element.
         */

        private INLGElement realisePhraseElement(PhraseElement phrase)
        {
            //Debug.WriteLine($"realise phrase element {phrase}");
            INLGElement realisedElement = null;

            if (phrase != null)
            {
                var category = phrase.getCategory();
                realisedElement = phrase;
                if (category is IPhraseCategory)
                {
                    switch ((PhraseCategoryEnum)category.enumType)
                    {
                    case PhraseCategoryEnum.CLAUSE:
                        realisedElement = ClauseHelper.realise(this, phrase);
                        break;

                    case PhraseCategoryEnum.NOUN_PHRASE:
                        realisedElement = NounPhraseHelper.realise(this, phrase);
                        break;

                    case PhraseCategoryEnum.VERB_PHRASE:
                        realisedElement = VerbPhraseHelper.realise(this, phrase);
                        break;

                    case PhraseCategoryEnum.PREPOSITIONAL_PHRASE:
                    case PhraseCategoryEnum.ADJECTIVE_PHRASE:
                    case PhraseCategoryEnum.ADVERB_PHRASE:
                        realisedElement = PhraseHelper.realise(this, phrase);
                        break;
                    }
                }
            }

            return(realisedElement);
        }