public void SoundexTest() { string s1 = Soundex.For("Jansen"); string s2 = Soundex.For("Jenssen"); Assert.AreEqual(s1, s2); }
public static int SoundExComparision(Person person) { string[] Words = new[] { "Spotify", "amal", "Sputfy", "Sputfi" }; int val = 0; //MatchRatingApproach _generator = new MatchRatingApproach(); //Console.WriteLine(_generator.IsSimilar(Words)); if (Soundex.For(person.FirstName) == Soundex.For(fName)) { val = val + 1; } if (Soundex.For(person.LastName) == Soundex.For(LName)) { val = val + 1; } else { val = val + 0; } return(val); }
public void ForTests() { Soundex soundex = new Soundex(); string word, expected, actual; word = ""; expected = "0000"; actual = soundex.For(word); Assert.AreEqual(expected, actual); word = null; expected = "0000"; actual = soundex.For(word); Assert.AreEqual(expected, actual); word = "Robert"; expected = "R163"; actual = soundex.For(word); Assert.AreEqual(expected, actual); word = "Rupert".ToLower(); actual = soundex.For(word); Assert.AreEqual(expected, actual); word = "Rubin"; expected = "R150"; actual = soundex.For(word); Assert.AreEqual(expected, actual); word = "Ashcraft"; expected = "A261"; actual = soundex.For(word); Assert.AreEqual(expected, actual); word = "Ashcroft"; actual = soundex.For(word); Assert.AreEqual(expected, actual); word = "Tymczak"; expected = "T522"; actual = soundex.For(word); Assert.AreEqual(expected, actual); word = "Pfister"; expected = "P236"; actual = soundex.For(word); Assert.AreEqual(expected, actual); }
public override bool IncrementToken() { if (input.IncrementToken()) { string currentTerm = _termAttr.Term; // Any phonetic hash calculation will work here. var hash = Soundex.For(currentTerm); _termAttr.SetTermBuffer(hash); return(true); } return(false); }
public override string GroomElement(string value) { return(Soundex.For(value)); }
public override string GroomElement(string value) => Soundex.For(value);
public override IMongoQuery BuildQuery(ITerm term) { string value = Soundex.For(term.Value); return(Query.EQ(term.Field, value)); }