public static SqlString LongPhonetic(SqlInt16 PhoneticType, SqlString InputString) { BasePhonetics PhoneticObject; string _inputString; if (InputString.IsNull || InputString.Value.Trim() == String.Empty) { _inputString = " "; } else { _inputString = InputString.Value; } switch (PhoneticType.Value) { case 0: PhoneticObject = new Soundex(_inputString); break; case 1: PhoneticObject = new RefinedSoundex(_inputString); break; case 2: PhoneticObject = new NYSIIS(_inputString); break; case 3: PhoneticObject = new DaitchMokotoff(_inputString); break; case 4: PhoneticObject = new Metaphone(_inputString); break; case 6: PhoneticObject = new ColognePhonetic(_inputString); break; default: PhoneticObject = new Soundex(_inputString); PhoneticType = 0; break; } PhoneticObject.Iterate(); return(PhoneticObject.ReadOutput()); }