public virtual double MatchCertainty(ITextResourceCollection textResource, string text) { text = text.ToLower(); var id = Id.ToString().ToLower(); var name = Name.Localise(textResource).ToLower(); var abbrev = Abbreviations?.Localise(textResource).ToLower().Split(','); return(new List <double> { id == text ? 0.95 : 0, name == text ? 0.9 : 0, abbrev?.Any(a => a == text) ?? false ? 0.9 : 0, id.StartsWith(text) ? 0.75 : 0, name.StartsWith(text) ? 0.7 : 0, id.Contains(text) ? 0.55 : 0, name.Contains(text) ? 0.5 : 0, id.Without(" ") == text.Without(" ") ? 0.35 : 0, name.Without(" ") == text.Without(" ") ? 0.3 : 0, id.Without(" ").StartsWith(text.Without(" ")) ? 0.15 : 0, name.Without(" ").StartsWith(text.Without(" ")) ? 0.1 : 0, }.Max()); }