示例#1
0
 private void MergeNodes(PhraseNode existingNode, PhraseNode newNode)
 {
     foreach (var newNext in newNode.Next)
     {
         if (!newNext.IsPlaceholder)
         {
             existingNode.AddNode(newNext);
         }
     }
 }
示例#2
0
        public void AddNode(PhraseNode node)
        {
            var nodeWithSameWord = Next.FirstOrDefault(n => n.BaseWord == node.BaseWord);

            if (nodeWithSameWord == null)
            {
                Next.Add(node);
            }
            else
            {
                MergeNodes(nodeWithSameWord, node);
            }
        }
示例#3
0
 public void Select(PhraseNode node)
 {
     SelectedNodes.Add(node);
 }
示例#4
0
 public PhraseTree(PhraseNode root) : this()
 {
     Root = root;
 }