コード例 #1
0
        public FiasParser(string connectionString)
        {
            DataContext = new FiasClassesDataContext(connectionString);
            DataContext.CommandTimeout = 0;
            if (!DataContext.DatabaseExists())
            {
                throw new BadLoginException("Не удалось подключиться к БД.");
            }

            bannedAbbriviatedNames = new List <string>();
            bannedAbbriviatedNames.Add("к.");
            bannedAbbriviatedNames.Add("вал");

            sb         = new StringBuilder();
            dictionary = GetDictionaryFromSql();

            dictionary.Add(new AddressSplitterLib.AddressObjectType("область", "область", 1, AddressSplitterLib.AddressObjectType.GenderNoun.Fiminine));
            dictionary.Add(new AddressSplitterLib.AddressObjectType("область", "обл", 1, AddressSplitterLib.AddressObjectType.GenderNoun.Fiminine));
            dictionary.Add(new AddressSplitterLib.AddressObjectType("проспект", "пр-т", 7));
            dictionary.Add(new AddressSplitterLib.AddressObjectType("проспект", "пр.", 7));
            dictionary.Add(new AddressSplitterLib.AddressObjectType("квартира", "к", 9));
            dictionary.Sort();
            parser = new AddressParser(dictionary);
        }