C# 클래스 ABB.Swum.Nodes.PhraseNode

Represents a phrase, consisting of one or more words.
상속: Node
파일 보기 프로젝트 열기: abb-iss/Swum.NET 1 사용 예제들

공개 메소드들

메소드 설명
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