예제 #1
0
 /// <summary> It prints the segment position information to the console.</summary>
 public virtual void  printPosition()
 {
     System.Console.Error.WriteLine("positionEnd: " + positionEnd);
     for (int i = 0; i < positionEnd; i++)
     {
         Trace.WriteLine(
             string.Format("position[{0}].key={1} nextPosition={2}", i, Code.toCompatibilityJamo(position[i].key), position[i].nextPosition));
     }
 }
예제 #2
0
 /// <summary> It prints the trie structure by recursive call.</summary>
 /// <param name="pw">- for printing the trie structure
 /// </param>
 /// <param name="idx">- the index of trie node
 /// </param>
 /// <param name="depth">- the depth of current node
 /// </param>
 /// <param name="tagSet">- the morpheme tag set used in the trie structure
 /// </param>
 public virtual void  print_trie(System.IO.StreamWriter pw, int idx, int depth, TagSet tagSet)
 {
     for (int i = 0; i < depth; i++)
     {
         pw.Write("\t");
     }
     pw.Write(idx + ":" + Code.toCompatibilityJamo(trie_buf[idx].key) + " ");
     if (trie_buf[idx].info_list != null)
     {
         for (int k = 0; k < trie_buf[idx].info_list.Count; k++)
         {
             pw.Write("t:" + tagSet.getTagName(trie_buf[idx].info_list.Get_Renamed(k).tag) + " ");
         }
     }
     pw.WriteLine();
     for (int i = 0; i < trie_buf[idx].child_size; i++)
     {
         print_trie(pw, trie_buf[idx].child_idx + i, depth + 1, tagSet);
     }
 }
예제 #3
0
        /// <summary> It prints the all data in the chart to the console.</summary>
        public virtual void  printMorphemeAll()
        {
            System.Console.Error.WriteLine("chartEnd: " + chartEnd);
            for (int i = 0; i < chartEnd; i++)
            {
                System.Console.Error.WriteLine("chartID: " + i);
                Trace.Write(
                    string.Format("{0}/{1}.{2} nextPosition={3} nextTagType={4} state={5} ", Code.toString(chart[i].str.ToCharArray()), tagSet.getTagName(chart[i].tag), tagSet.getIrregularName(chart[i].phoneme), Code.toCompatibilityJamo(sp.getPosition(chart[i].nextPosition).key), tagSet.getTagName(chart[i].nextTagType), chart[i].state));

                System.Console.Error.Write("connection=");
                for (int j = 0; j < chart[i].connectionCount; j++)
                {
                    Trace.Write(chart[i].connection[j] + ", ");
                }
                Trace.Write(Environment.NewLine);
            }
        }