public static void Populate(IStringDictionary<string> dictionary) { int insertions = 0; DictionarySanitizer.WriteSanitizedDictionary(); string[] lines = File.ReadAllLines(WebConfigurationManager.AppSettings[Constants.DICTIONARY_FILE__PROCESSED]); foreach (string l in lines) { string[] parts = l.Split(new string[] { "======" }, StringSplitOptions.None); string word = parts[0].Trim().ToLowerInvariant(); if (Regex.IsMatch(word, @"^[a-zA-Z]+$")) { if (dictionary.TryAddWord(word, parts[1].Trim())) { insertions++; } if (dictionary.TryAddWord(word + "x", parts[1].Trim())) { insertions++; } if (dictionary.TryAddWord(word + "xx", parts[1].Trim())) { insertions++; } } } }
public static void Populate() { //Dictionary = new Trie<string>(); //Dictionary = new ListDictionary(); Dictionary = new StringHashTable<string>(); DictionaryPopulator.Populate(Dictionary); }
private static IStringDictionary InvokeWorkflow(string xamlString, IStringDictionary inputs = null) { var activity = ActivityXamlServices.Load(new StringReader(xamlString), new ActivityXamlServicesSettings { CompileExpressions = true }); return(WorkflowInvoker.Invoke(activity, inputs ?? new StringDictionary())); }