/// <summary> /// This will return any name Given Names or Surnames that can be generated by the given letters. /// </summary> /// <param name="myString"></param> /// <returns></returns> public static List <string> GetNameAnagrams(this string myString) { var result = new List <string>(); var lowered = myString.ToLower(); var properNames = new ProperNameCollection(); var permutations = lowered.GetPermutations(); foreach (var candidateName in from candidateName in permutations let isName = properNames.IsGivenName(candidateName) || properNames.IsSurname(candidateName) where isName where !result.Contains(candidateName.GetCapitalized()) select candidateName) { result.Add(candidateName.GetCapitalized()); } return(result); }
/* If it is a known surname return ture; false otherwise.*/ public static bool IsSurname(this string myString) { ProperNameCollection names = new ProperNameCollection(); return names.IsSurname(myString); }
/* If it is a known surname return ture; false otherwise.*/ public static bool IsSurname(this string myString) { ProperNameCollection names = new ProperNameCollection(); return(names.IsSurname(myString)); }