/// <summary>
        /// Returns dictionary for the passed culture.
        /// </summary>
        /// <param name="cultName">e.g., "en-US", or "ru-RU"</param>
        /// <returns>null, if there's no such dictionary</returns>
        public SpellDictionary GetDictionary(string cultName)
        {
            SpellDictionary dict= null;
            cultName = cultName.ToLower ();
            if (dictionaries.ContainsKey (cultName))
            {
                dict = dictionaries[cultName];
            }
            else
            {
                try
                {
                    dict = new SpellDictionary (cultName);

                    string path = System.IO.Path.Combine (DictionariesBaseFolder, cultName);
                    dict.Load (path);

                    dictionaries.Add (cultName, dict);
                }
                catch (Exception)
                {
                    dict= null;
                }
            }

            return dict;
        }
Example #2
0
 public static void LoadDictionary(TestContext testContext)
 {
     dic = new SpellDictionary ("test");
     string path = System.IO.Path.Combine (testContext.TestDeploymentDir, @"dics\test");
     dic.Load (path);
 }