Ejemplo n.º 1
0
        static public void Load(string fileName)
        {
            //if (System.IO.File.Exists(fileName))
            //{
            //    try
            //    {
            //        using (System.IO.FileStream fs = new System.IO.FileStream(fileName, System.IO.FileMode.Open,
            //             System.IO.FileAccess.Read))
            //        {
            //            _Config = XmlSerialization<PanGuSettings>.Deserialize(fs);
            //        }
            //    }
            //    catch
            //    {
            //        _Config = new PanGuSettings();
            //    }
            //}
            //else
            //{
            //    _Config = new PanGuSettings();
            //}
            _Config = new PanGuSettings();
            _Config.DictionaryPath = "max-assets/Dictionaries"; //"../max-assets/Dictionaries";
            _Config.MatchOptions.ChineseNameIdentify = true;
            _Config.MatchOptions.FilterNumeric = true;
            _Config.MatchOptions.FilterStopWords = true;
            _Config.MatchOptions.IgnoreSpace = true;
            _Config.MatchOptions.UnknownWordIdentify = true;

            _Config.Parameters.BestRank = 5;
            _Config.Parameters.EnglishLowerRank = 3;
            _Config.Parameters.EnglishRank = 5;
            _Config.Parameters.EnglishStemRank = 2;
            _Config.Parameters.FilterEnglishLength = 0;
            _Config.Parameters.FilterNumericLength = 0;
            _Config.Parameters.NumericRank = 1;
            _Config.Parameters.Redundancy = 0;
            _Config.Parameters.SecRank = 3;
            _Config.Parameters.SimplifiedTraditionalRank = 1;
            _Config.Parameters.SingleRank = 1;
            _Config.Parameters.SymbolRank = 1;
            _Config.Parameters.SynonymRank = 1;
            _Config.Parameters.ThirdRank = 1;
            _Config.Parameters.UnknowRank = 1;
            _Config.Parameters.WildcardRank = 1;
        }
Ejemplo n.º 2
0
        static public void Load(string fileName)
        {
            //if (System.IO.File.Exists(fileName))
            //{
            //    try
            //    {
            //        using (System.IO.FileStream fs = new System.IO.FileStream(fileName, System.IO.FileMode.Open,
            //             System.IO.FileAccess.Read))
            //        {
            //            _Config = XmlSerialization<PanGuSettings>.Deserialize(fs);
            //        }
            //    }
            //    catch
            //    {
            //        _Config = new PanGuSettings();
            //    }
            //}
            //else
            //{
            //    _Config = new PanGuSettings();
            //}
            _Config = new PanGuSettings();
            _Config.DictionaryPath = "max-assets/Dictionaries"; //"../max-assets/Dictionaries";
            _Config.MatchOptions.ChineseNameIdentify = true;
            _Config.MatchOptions.FilterNumeric       = true;
            _Config.MatchOptions.FilterStopWords     = true;
            _Config.MatchOptions.IgnoreSpace         = true;
            _Config.MatchOptions.UnknownWordIdentify = true;

            _Config.Parameters.BestRank                  = 5;
            _Config.Parameters.EnglishLowerRank          = 3;
            _Config.Parameters.EnglishRank               = 5;
            _Config.Parameters.EnglishStemRank           = 2;
            _Config.Parameters.FilterEnglishLength       = 0;
            _Config.Parameters.FilterNumericLength       = 0;
            _Config.Parameters.NumericRank               = 1;
            _Config.Parameters.Redundancy                = 0;
            _Config.Parameters.SecRank                   = 3;
            _Config.Parameters.SimplifiedTraditionalRank = 1;
            _Config.Parameters.SingleRank                = 1;
            _Config.Parameters.SymbolRank                = 1;
            _Config.Parameters.SynonymRank               = 1;
            _Config.Parameters.ThirdRank                 = 1;
            _Config.Parameters.UnknowRank                = 1;
            _Config.Parameters.WildcardRank              = 1;
        }
Ejemplo n.º 3
0
 static public void Load(string fileName)
 {
     if (System.IO.File.Exists(fileName))
     {
         try
         {
             using (System.IO.FileStream fs = new System.IO.FileStream(fileName, System.IO.FileMode.Open,
                                                                       System.IO.FileAccess.Read))
             {
                 _Config = XmlSerialization <PanGuSettings> .Deserialize(fs);
             }
         }
         catch
         {
             _Config = new PanGuSettings();
         }
     }
     else
     {
         _Config = new PanGuSettings();
     }
 }
 static public void Load(string fileName)
 {
     if (System.IO.File.Exists(fileName))
     {
         try
         {
             using (System.IO.FileStream fs = new System.IO.FileStream(fileName, System.IO.FileMode.Open,
                  System.IO.FileAccess.Read))
             {
                 _Config = XmlSerialization<PanGuSettings>.Deserialize(fs);
             }
         }
         catch
         {
             _Config = new PanGuSettings();
         }
     }
     else
     {
         _Config = new PanGuSettings();
     }
 }
Ejemplo n.º 5
0
 private void Load(string fileName)
 {
     PanGuSettings.Load(fileName);
 }