コード例 #1
0
 void PrintNode(AttemptsTreeNode node, String cText)
 {
     foreach (AttemptsTreeNode temp in node.NextLevel)
     {
         Console.WriteLine(node.GetVal(cText));
         if (temp.NextLevel.Count != 0)
         {
             PrintNode(temp, cText);
         }
     }
 }
コード例 #2
0
        bool ContainsCommonStuff(AttemptsTreeNode node, String originalText)
        {
            foreach (String c in commonDigraphs)
            {
                if (node.GetVal(originalText).Contains(c))
                {
                    return(true);
                }
            }

            foreach (String c in commonWords)
            {
                if (node.GetVal(originalText).Contains(c))
                {
                    return(true);
                }
            }

            return(false);
        }
コード例 #3
0
        void CountCommon(AttemptsTreeNode node, String originalText)
        {
            foreach (String c in commonDigraphs)
            {
                if (node.GetVal(originalText).Contains(c))
                {
                    node.NumCommon++;
                }
            }

            foreach (String c in commonWords)
            {
                if (node.GetVal(originalText).Contains(c))
                {
                    node.NumCommon++;
                }
            }

            foreach (AttemptsTreeNode next in node.NextLevel)
            {
                CountCommon(next, originalText);
            }
        }