Exemple #1
0
 public static void BuildWordTree()
 {
     instance = WordTree.CreateWordTree();
     String[] dicts = Directory.GetFiles(Directorys.DictsDirectory, "*.dic");
     if (dicts != null)
     {
         for (int i = 0; i < dicts.Length; i++)
         {
             StreamReader reader = File.OpenText(dicts[i]);
             try
             {
                 String line = null;
                 while ((line = reader.ReadLine()) != null)
                 {
                     line = line.Trim();
                     if (!line.StartsWith("#") && line.Length > 1)
                     {
                         instance.Add(line);
                     }
                 }
             }
             finally
             {
                 if (reader != null)
                 {
                     reader.Close();
                 }
             }
         }
     }
 }
 public static void BuildWordTree()
 {
     instance = WordTree.CreateWordTree();
     String[] dicts = Directory.GetFiles(Directorys.DictsDirectory, "*.dic");
     if (dicts != null)
     {
         for (int i = 0; i < dicts.Length; i++)
         {
             StreamReader reader = File.OpenText(dicts[i]);
             try
             {
                 String line = null;
                 while ((line = reader.ReadLine()) != null)
                 {
                     line = line.Trim();
                     if (!line.StartsWith("#") && line.Length > 1)
                     {
                         instance.Add(line);
                     }
                 }
             }
             finally
             {
                 if (reader != null)
                     reader.Close();
             }
         }
     }
 }
 public AssociateStream()
 {
     tree = WordTreeFactory.GetInstance();
     currNode = Root;
 }
 public AssociateStream()
 {
     tree     = WordTreeFactory.GetInstance();
     currNode = Root;
 }