Beispiel #1
0
        static void Learn(string languageCode, string newLanguageFile, string knownLanguagesFile)
        {
            var learner = new LanguageLearner();

            learner.Learn(languageCode, newLanguageFile, knownLanguagesFile);

            Console.WriteLine("The language '{0}' has been learned!", languageCode);
        }
Beispiel #2
0
        private static void Learn(string languageCode, string newLanguageFile, string knownLanguagesFile) ///Resources
        {
            //if you want add language
            var learner = new LanguageLearner();

            learner.Learn(languageCode, newLanguageFile, knownLanguagesFile);

            Console.WriteLine("The language '{0}' has been learned!", languageCode);
        }
Beispiel #3
0
        public static string Detect(string inputString)
        {
            var learner        = new LanguageLearner();
            var knownLanguages = learner.Remember(_knownLanguagesFile);
            var detector       = new LanguageDetector(knownLanguages);


            return(detector.Detect(inputString));

            //Console.WriteLine("The language code of the detected language is: {0}", languageCode);
        }
Beispiel #4
0
        static void Detect(string file, string choice, string knownLanguagesFile)
        {
            var learner = new LanguageLearner();

            var knownLanguages = learner.Remember(knownLanguagesFile);

            var detector = new LanguageDetector(knownLanguages);

            //int score;

            var languageCode = detector.Detect(file, choice);

            Console.WriteLine("The language code of the detected language is: {0}", languageCode);
        }