public void MigemoAllCharTest() { if (!Migemo.IsEnable()) { var solutionDir = Directory.GetParent(Directory.GetParent(Directory.GetParent(Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly().Location).FullName).FullName).FullName).FullName; var migemoDllPath = Path.Combine(solutionDir, "assemblies", "Migemo"); var migemoDictionaryPath = Path.Combine(solutionDir, "assemblies", "Migemo", "dict", "migemo-dict"); //Console.WriteLine(settings.MigemoDllPath); //Console.WriteLine(settings.MigemoDictionaryPath); Migemo.Initialize(migemoDllPath, migemoDictionaryPath); } if (!Migemo.IsEnable()) { // Fail: Migemo initialize Assert.Fail(); } for (var test = Convert.ToChar(0); test <= 255; test++) { try { var ret = Migemo.GetRegex(test.ToString()); //Console.WriteLine("{0}, {1}", test, ret.ToString()); } catch { Assert.Fail(); } } }
public void OnUseMigemoChecked() { Settings.UseMigemo = true; try { Migemo.Initialize(Settings.MigemoDllPath, Settings.MigemoDictionaryPath); } catch (Exception ex) { UIAssistantAPI.Instance.NotificationAPI.NotifyWarnMessage("Load Migemo Error", $"{ex.Message}"); } }
public DefaultFilter() { var api = UIAssistantAPI.Instance; try { if (!Migemo.IsEnable() && api.UIAssistantSettings.UseMigemo) { Migemo.Initialize(api.UIAssistantSettings.MigemoDllPath, api.UIAssistantSettings.MigemoDictionaryPath); } } catch (Exception ex) { api.NotificationAPI.NotifyWarnMessage("Load Migemo Error", $"{ex.Message}"); api.LogAPI.WriteErrorMessage(ex); } }