ABB.Swum.Nodes.PhraseNode.Parse C# (CSharp) Method

Parse() public static method

Creates a PhraseNode by parsing the given string representation.
public static Parse ( string source ) : PhraseNode
source string The string to parse the PhraseNode from.
return PhraseNode
        public static PhraseNode Parse(string source) {
            if(source == null) {
                throw new ArgumentNullException("source");
            }

            var words = source.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries);
            var pn = new PhraseNode();
            foreach(var word in words) {
                pn.Words.Add(WordNode.Parse(word));
            }
            return pn;
        }