static void test_2() { var dataFileName = @"E:\GeoDB\DiskSearchEngine\data\fusking.rotter.data"; var dataFileEncoding = Encoding.UTF7; //Encoding.Unicode; //Encoding.UTF8; // create_datafile_in_need_encoding(dataFileName, dataFileEncoding); //var indexHeader = HashtableIndexer.GetIndexHeaderByDataFile( dataFileName ); var allRecordCountInDataFile = HashtableEngineHelper.CalulateAllRecordCountInDataFile(dataFileName, dataFileEncoding); HashtableIndexer.BuildIndex(dataFileName, dataFileEncoding, allRecordCountInDataFile.NearestPrimeNumber(), HashtableEngineHelper.NormlizeText); using (var searcher = new HashtableSearcher(dataFileName, HashtableEngineHelper.NormlizeText)) { var max_len = geo_names.Max(_ => _.Length); searcher.IsExists1("кызыл-орда", max_len); foreach (var geo_name in geo_names) { searcher.IsExists1(geo_name, max_len); } } }
static void test_Search_small(string dataFileName) { using (var searcher = new HashtableSearcher(dataFileName, HashtableEngineHelper.NormlizeText)) { var max_len = geo_names.Max(_ => _.Length); searcher.IsExists1("кызыл-орда", max_len); foreach (var geo_name in geo_names) { searcher.IsExists1(geo_name, max_len); } } }