C# Class ABB.Swum.Nodes.PhraseNode

Represents a phrase, consisting of one or more words.
Inheritance: Node
Afficher le fichier Open project: abb-iss/Swum.NET Class Usage Examples

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
InitWords ( IEnumerable words ) : void

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

Method Details

Add() public méthode

Concatenates the supplied phrase to the end of the current phrase.
public Add ( PhraseNode phrase ) : void
phrase PhraseNode The phrase to add.
Résultat void

Add() public méthode

Adds the given word to the end of the phrase.
public Add ( WordNode word ) : void
word WordNode The word to add.
Résultat void

FirstWord() public méthode

Returns the first word in the phrase.
public FirstWord ( ) : WordNode
Résultat WordNode

GetNewEmpty() public méthode

Creates a new empty node of the same type.
public GetNewEmpty ( ) : PhraseNode
Résultat PhraseNode

GetParse() public méthode

Returns a PhraseNode containing the node's parsed name, i.e. returns itself.
public GetParse ( ) : PhraseNode
Résultat PhraseNode

GetPhrase() public méthode

Returns a list of the words in the phrase.
public GetPhrase ( ) : Collection
Résultat Collection

GetWord() public méthode

Returns the word within the phrase at the given index.
public GetWord ( int wordIndex ) : WordNode
wordIndex int The index of the word to get.
Résultat WordNode

InitWords() protected méthode

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.
Résultat void

IsEmpty() public méthode

Reports whether there are any words in the phrase.
public IsEmpty ( ) : bool
Résultat bool

LastWord() public méthode

Returns the last word in the phrase.
public LastWord ( ) : WordNode
Résultat WordNode

Parse() public static méthode

Creates a PhraseNode by parsing the given string representation.
public static Parse ( string source ) : PhraseNode
source string The string to parse the PhraseNode from.
Résultat PhraseNode

PhraseNode() public méthode

Creates a new empty PhraseNode.
public PhraseNode ( ) : System
Résultat System

PhraseNode() public méthode

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.
Résultat System

PhraseNode() public méthode

Creates a new PhraseNode, containing the given words.
public PhraseNode ( IEnumerable words ) : System
words IEnumerable The words in the phrase.
Résultat System

PhraseNode() public méthode

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.
Résultat System

RemoveWord() public méthode

Removes the word from the phrase at the given index.
public RemoveWord ( int wordIndex ) : void
wordIndex int The index of the word to remove.
Résultat void

SetLocation() public méthode

Sets the program location of the node.
public SetLocation ( Location location ) : void
location Location The location of the node.
Résultat void

Size() public méthode

Returns the number of words in the phrase.
public Size ( ) : int
Résultat int

ToPlainString() public méthode

Return a string representation of the PhraseNode without any added SWUM markup.
public ToPlainString ( ) : string
Résultat string

ToString() public méthode

Creates a string representation of the PhraseNode, containing a string version of each word.
public ToString ( ) : string
Résultat string

this() public méthode

Returns the word within the phrase at the given index.
public this ( int wordIndex ) : WordNode
wordIndex int The index of the word to get.
Résultat WordNode