ABB.Swum.UnigramMethodRule.GetNounPhrase C# (CSharp) Метод

GetNounPhrase() приватный Метод

Returns a PhraseNode containing the noun phrase words from the given name, starting from startIndex. All noun phrase words prior to the first encountered preposition are included.
private GetNounPhrase ( PhraseNode parsedName, int startIndex ) : PhraseNode
parsedName ABB.Swum.Nodes.PhraseNode The PhraseNode to get the noun phrase from.
startIndex int The index of the word to start from.
Результат ABB.Swum.Nodes.PhraseNode
        private PhraseNode GetNounPhrase(PhraseNode parsedName, int startIndex)
        {
            PhraseNode phrase = parsedName.GetNewEmpty();
            for (int i = startIndex; i < parsedName.Size(); i++)
            {
                PartOfSpeechTag tag = parsedName[i].Tag;
                if (tag == PartOfSpeechTag.Noun
                    || tag == PartOfSpeechTag.NounModifier
                    || tag == PartOfSpeechTag.Determiner
                    || tag == PartOfSpeechTag.Pronoun
                    || tag == PartOfSpeechTag.NounIgnorable
                    || tag == PartOfSpeechTag.Digit
                    || tag == PartOfSpeechTag.Preamble)
                {
                    phrase.Add(parsedName[i]);
                }
                else if (tag == PartOfSpeechTag.Preposition)
                {
                    break;
                }
            }
            return phrase;
        }

Same methods

UnigramMethodRule::GetNounPhrase ( PhraseNode parsedName ) : PhraseNode