Example #1
0
 /// <summary>
 /// 构造函数 初始或所有的001文件
 /// </summary>
 /// <param name="DataType">数据类型,只有中文CN|引文EN</param>
 /// <param name="configFilePath">配置文件路径</param>
 /// <param name="strOutPutPath">输出目录</param>
 public NewSplit(string configFilePath, string strOutPutPath, string strDataPath, log log)
 {
     DataPath = strDataPath;
     DataFileName = Path.GetFileNameWithoutExtension(configFilePath).Replace(".cfg", "");
     config = new DataInterfaceConfig(configFilePath);
     lstSearchEnter = config.SearchEnters;
     OutPutPath = strOutPutPath;
     this.Type = config.Type;
     this.lg = log;
     Sept = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["Sept"].ToString());
     this.FileMode = FileMode.CreateNew;
 }
Example #2
0
        /// <summary>
        /// Finder初始化
        /// </summary>
        /// <returns></returns>
        public bool Ini()
        {
            ConfigFilePath = System.Configuration.ConfigurationManager.AppSettings["ConfigFile"].ToString();
            IndexDirectory = Path.GetDirectoryName(ConfigFilePath);
            _Indexs = new Dictionary<string, List<MemoryIndex>>();
            _Config = new DataInterfaceConfig(ConfigFilePath);
            List<Key> lstKey = Config.GetSearchEnterKey();

            //1.得到所有的索引分段文件夹
            foreach (Key key in lstKey)
            {
                //得到所有的文件
                string[] indexfiles = Directory.GetFiles(IndexDirectory, key.Name + ".eee", SearchOption.AllDirectories);
                List<MemoryIndex> lstIndex = new List<MemoryIndex>();
                foreach (string indexfile in indexfiles)
                {

                    //实例化索引
                    MemoryIndex ix = new MemoryIndex(indexfile, key);
                    //添加到集合里
                    lstIndex.Add(ix);
                }
                //添加到字典中
                _Indexs.Add(key.Name, lstIndex);

            }
            return true;
        }
Example #3
0
 public SearchPattern(DataInterfaceConfig config)
 {
     this.Config = config;
 }
Example #4
0
        /// <summary>
        /// Finder初始化
        /// </summary>
        /// <returns></returns>
        public bool Ini()
        {
            //IndexDirectory = Path.GetDirectoryName(ConfigFilePath) + "\\" + reginfo.VYear + "\\" + Lib.reginfo.UserSelected;

            _Indexs = new Dictionary<string, List<FileIndex>>();
            _Config = new DataInterfaceConfig(ConfigFilePath);
            Type = _Config.Type;
            List<Key> lstKey = Config.GetSearchEnterKey();

            //1.得到所有的索引分段文件夹
            foreach (Key key in lstKey)
            {
                //得到所有的文件
                List<string> indexfiles = Directory.GetFiles(IndexDirectory, key.Name + ".eee", SearchOption.AllDirectories).ToList<string>();
                indexfiles.Sort();
                List<FileIndex> lstIndex = new List<FileIndex>();
                foreach (string indexfile in indexfiles)
                {

                    //实例化索引
                    FileIndex ix = new FileIndex(indexfile, key);
                    //添加到集合里
                    lstIndex.Add(ix);
                }
                //添加到字典中
                _Indexs.Add(key.Name, lstIndex);

            }
            return true;
        }