コード例 #1
0
ファイル: Program.cs プロジェクト: weselow/LanguageDetection
        /// <summary>
        /// load profiles
        /// </summary>
        /// <returns>false if load success</returns>
        private bool LoadProfile()
        {
            string profileDirectory = Get("directory");

            try
            {
                if (profileDirectory != null)
                {
                    DetectorFactory.LoadProfile(profileDirectory);
                }
                else
                {
                    DetectorFactory.LoadProfile();
                }

                long?seed = GetLong("seed");
                if (seed != null)
                {
                    DetectorFactory.SetSeed((int)seed);
                }

                return(false);
            }
            catch (LangDetectException e)
            {
                Console.Error.WriteLine("ERROR: " + e);
                return(true);
            }
        }