示例#1
0
    public IEnumerable <City> Find(string find, StringComparison stringComparison = StringComparison.OrdinalIgnoreCase)
    {
        var normalizedFind = _suffixdict.NormalizeString(find);

        foreach (var city in _suffixdict.GetDistinct(normalizedFind).Where(v => v.Name.IndexOf(normalizedFind, stringComparison) >= 0))
        {
            yield return(city);
        }
    }
示例#2
0
    public IEnumerable <City> Find(string find)
    {
        var normalizedFind = _suffixdict.NormalizeString(find);

        foreach (var id in _suffixdict.Get(normalizedFind).Where(v => _cities[v].Name.IndexOf(normalizedFind, StringComparison.OrdinalIgnoreCase) >= 0))
        {
            yield return(_cities[id]);
        }
    }