Example #1
0
        static private void LoadDictionary()
        {
            _WordDictionary = new PanGu.Dict.WordDictionary();
            string dir = Setting.PanGuSettings.Config.GetDictionaryPath();

            _WordDictionary.Load(System.IO.Path.Combine(dir, "Dict.dct"));

            _ChsName = new PanGu.Dict.ChsName();
            _ChsName.LoadChsName(Setting.PanGuSettings.Config.GetDictionaryPath());


            _WordDictionary.ChineseName = _ChsName;

            _StopWord = new PanGu.Dict.StopWord();
            _StopWord.LoadStopwordsDict(System.IO.Path.Combine(dir, "Stopword.txt"));

            _Synonym = new PanGu.Dict.Synonym();

            if (Setting.PanGuSettings.Config.MatchOptions.SynonymOutput)
            {
                _Synonym.Load(dir);
            }

            _DictLoader = new PanGu.Dict.DictionaryLoader(Setting.PanGuSettings.Config.GetDictionaryPath());
        }
Example #2
0
        static private void LoadDictionary()
        {
            _WordDictionary = new PanGu.Dict.WordDictionary();
            string dir = Setting.PanGuSettings.Config.GetDictionaryPath();

            _WordDictionary.Load(dir + "Dict.Dct");

            _ChsName = new PanGu.Dict.ChsName();
            _ChsName.LoadChsName(Setting.PanGuSettings.Config.GetDictionaryPath());


            _WordDictionary.ChineseName = _ChsName;

            _StopWord = new PanGu.Dict.StopWord();
            _StopWord.LoadStopwordsDict(dir + "Stopword.txt");

            _Synonym = new PanGu.Dict.Synonym();

            if (Setting.PanGuSettings.Config.MatchOptions.SynonymOutput)
            {
                _Synonym.Load(dir);
            }

            _Wildcard = new PanGu.Dict.Wildcard(Setting.PanGuSettings.Config.MatchOptions,
                                                Setting.PanGuSettings.Config.Parameters);

            if (Setting.PanGuSettings.Config.MatchOptions.WildcardOutput)
            {
                _Wildcard.Load(dir);
            }

            _DictLoader = new PanGu.Dict.DictionaryLoader(Setting.PanGuSettings.Config.GetDictionaryPath());
        }
Example #3
0
        static private void LoadDictionary(string fileName)
        {
            String currentDir = "";
            string sysdir     = "";

            if (!string.IsNullOrEmpty(fileName))
            {
                System.IO.DirectoryInfo info = new System.IO.DirectoryInfo(fileName);
                currentDir  = info.Parent.Parent.FullName;
                currentDir += "/";
            }
            else
            {
                currentDir = PanGu.Framework.Path.GetAssemblyPath();
            }
            sysdir = Setting.PanGuSettings.Config.GetDictionaryPath(fileName);
            IOHelper.WriteLog("path1=" + currentDir);
            _WordDictionary = new PanGu.Dict.WordDictionary();
            string dir = currentDir + sysdir + "/";

            IOHelper.WriteLog("dir=" + dir + "Dict.dct");
            _WordDictionary.Load(dir + "Dict.dct");

            _ChsName = new PanGu.Dict.ChsName();
            IOHelper.WriteLog("_ChsName1=" + _ChsName);
            _ChsName.LoadChsName(currentDir + sysdir + "/");
            IOHelper.WriteLog("_ChsName2=" + _ChsName);

            _WordDictionary.ChineseName = _ChsName;
            IOHelper.WriteLog("_ChsName3=" + _ChsName);
            _StopWord = new PanGu.Dict.StopWord();
            IOHelper.WriteLog("dir=" + dir + "Stopword.txt");
            _StopWord.LoadStopwordsDict(dir + "Stopword.txt");

            _Synonym = new PanGu.Dict.Synonym();

            if (Setting.PanGuSettings.Config.MatchOptions.SynonymOutput)
            {
                _Synonym.Load(dir);
            }

            _DictLoader = new PanGu.Dict.DictionaryLoader(sysdir);
        }
Example #4
0
        static private void LoadDictionary()
        {
            _WordDictionary = new PanGu.Dict.WordDictionary();
            string dir = Setting.PanGuSettings.Config.GetDictionaryPath();
            _WordDictionary.Load(dir + "Dict.Dct");

            _ChsName = new PanGu.Dict.ChsName();
            _ChsName.LoadChsName(Setting.PanGuSettings.Config.GetDictionaryPath());


            _WordDictionary.ChineseName = _ChsName;

            _StopWord = new PanGu.Dict.StopWord();
            _StopWord.LoadStopwordsDict(dir + "Stopword.txt");

            _Synonym = new PanGu.Dict.Synonym();

            if (Setting.PanGuSettings.Config.MatchOptions.SynonymOutput)
            {
                _Synonym.Load(dir);
            }

            _Wildcard = new PanGu.Dict.Wildcard(Setting.PanGuSettings.Config.MatchOptions,
                Setting.PanGuSettings.Config.Parameters);

            if (Setting.PanGuSettings.Config.MatchOptions.WildcardOutput)
            {
                _Wildcard.Load(dir);
            }

            _DictLoader = new PanGu.Dict.DictionaryLoader(Setting.PanGuSettings.Config.GetDictionaryPath());
        }