public static void ClassCleanup() { stringMatcher = null; phoneticMatcher = null; hybridMatcher = null; normalizedMatchers = null; }
public void GivenMissingTransformation_ExpectException() { Assert.ThrowsException <InvalidCastException>(() => { var matcher = new StringFuzzyMatcher <MyTargetType>(Targets); }); Assert.ThrowsException <InvalidCastException>(() => { var matcher = new EnPhoneticFuzzyMatcher <MyTargetType>(Targets); }); Assert.ThrowsException <InvalidCastException>(() => { var matcher = new EnHybridFuzzyMatcher <MyTargetType>(Targets, PhoneticWeightPercentage); }); }
public static string demoMethod(string Recognized) { string[] targets = { "Back", "Red", "Home", "Decrease" }; var matcher = new EnPhoneticFuzzyMatcher <string>(targets); var result = matcher.FindNearest("Right"); return(result.ToString()); }