C# Класс ABB.Swum.Nodes.PhraseNode

Represents a phrase, consisting of one or more words.
Наследование: Node
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Add ( PhraseNode phrase ) : void

Concatenates the supplied phrase to the end of the current phrase.

Add ( WordNode word ) : void

Adds the given word to the end of the phrase.

FirstWord ( ) : WordNode

Returns the first word in the phrase.

GetNewEmpty ( ) : PhraseNode

Creates a new empty node of the same type.

GetParse ( ) : PhraseNode

Returns a PhraseNode containing the node's parsed name, i.e. returns itself.

GetPhrase ( ) : Collection

Returns a list of the words in the phrase.

GetWord ( int wordIndex ) : WordNode

Returns the word within the phrase at the given index.

IsEmpty ( ) : bool

Reports whether there are any words in the phrase.

LastWord ( ) : WordNode

Returns the last word in the phrase.

Parse ( string source ) : PhraseNode

Creates a PhraseNode by parsing the given string representation.

PhraseNode ( ) : System

Creates a new empty PhraseNode.

PhraseNode ( IEnumerable words, Location location, bool containsPreposition ) : System

Creates a new PhraseNode that contains the given words.

PhraseNode ( IEnumerable words ) : System

Creates a new PhraseNode, containing the given words.

PhraseNode ( string id, IdSplitter splitter ) : System

Creates a new PhraseNode that contains the words resulting from splitting the given identifier.

RemoveWord ( int wordIndex ) : void

Removes the word from the phrase at the given index.

SetLocation ( Location location ) : void

Sets the program location of the node.

Size ( ) : int

Returns the number of words in the phrase.

ToPlainString ( ) : string

Return a string representation of the PhraseNode without any added SWUM markup.

ToString ( ) : string

Creates a string representation of the PhraseNode, containing a string version of each word.

this ( int wordIndex ) : WordNode

Returns the word within the phrase at the given index.

Защищенные методы

Метод Описание
InitWords ( IEnumerable words ) : void

Initializes the list of WordNodes by creating a new node for each word string.

Описание методов

Add() публичный Метод

Concatenates the supplied phrase to the end of the current phrase.
public Add ( PhraseNode phrase ) : void
phrase PhraseNode The phrase to add.
Результат void

Add() публичный Метод

Adds the given word to the end of the phrase.
public Add ( WordNode word ) : void
word WordNode The word to add.
Результат void

FirstWord() публичный Метод

Returns the first word in the phrase.
public FirstWord ( ) : WordNode
Результат WordNode

GetNewEmpty() публичный Метод

Creates a new empty node of the same type.
public GetNewEmpty ( ) : PhraseNode
Результат PhraseNode

GetParse() публичный Метод

Returns a PhraseNode containing the node's parsed name, i.e. returns itself.
public GetParse ( ) : PhraseNode
Результат PhraseNode

GetPhrase() публичный Метод

Returns a list of the words in the phrase.
public GetPhrase ( ) : Collection
Результат Collection

GetWord() публичный Метод

Returns the word within the phrase at the given index.
public GetWord ( int wordIndex ) : WordNode
wordIndex int The index of the word to get.
Результат WordNode

InitWords() защищенный Метод

Initializes the list of WordNodes by creating a new node for each word string.
protected InitWords ( IEnumerable words ) : void
words IEnumerable String versions of the words in the phrase.
Результат void

IsEmpty() публичный Метод

Reports whether there are any words in the phrase.
public IsEmpty ( ) : bool
Результат bool

LastWord() публичный Метод

Returns the last word in the phrase.
public LastWord ( ) : WordNode
Результат WordNode

Parse() публичный статический Метод

Creates a PhraseNode by parsing the given string representation.
public static Parse ( string source ) : PhraseNode
source string The string to parse the PhraseNode from.
Результат PhraseNode

PhraseNode() публичный Метод

Creates a new empty PhraseNode.
public PhraseNode ( ) : System
Результат System

PhraseNode() публичный Метод

Creates a new PhraseNode that contains the given words.
public PhraseNode ( IEnumerable words, Location location, bool containsPreposition ) : System
words IEnumerable A list of the words in the phrase.
location Location The program location of the phrase.
containsPreposition bool Whether the phrase contains any prepositions or not.
Результат System

PhraseNode() публичный Метод

Creates a new PhraseNode, containing the given words.
public PhraseNode ( IEnumerable words ) : System
words IEnumerable The words in the phrase.
Результат System

PhraseNode() публичный Метод

Creates a new PhraseNode that contains the words resulting from splitting the given identifier.
public PhraseNode ( string id, IdSplitter splitter ) : System
id string A program identifier.
splitter ABB.Swum.IdSplitter An IdSplitter to split the given identifier into words.
Результат System

RemoveWord() публичный Метод

Removes the word from the phrase at the given index.
public RemoveWord ( int wordIndex ) : void
wordIndex int The index of the word to remove.
Результат void

SetLocation() публичный Метод

Sets the program location of the node.
public SetLocation ( Location location ) : void
location Location The location of the node.
Результат void

Size() публичный Метод

Returns the number of words in the phrase.
public Size ( ) : int
Результат int

ToPlainString() публичный Метод

Return a string representation of the PhraseNode without any added SWUM markup.
public ToPlainString ( ) : string
Результат string

ToString() публичный Метод

Creates a string representation of the PhraseNode, containing a string version of each word.
public ToString ( ) : string
Результат string

this() публичный Метод

Returns the word within the phrase at the given index.
public this ( int wordIndex ) : WordNode
wordIndex int The index of the word to get.
Результат WordNode