Esempio n. 1
0
        public void setUp()
        {
            DetectorFactory.Clear();

            LangProfile profile_en = new LangProfile("en");

            foreach (string w in TRAINING_EN.Split(" "))
            {
                profile_en.Add(w);
            }
            DetectorFactory.AddProfile(profile_en, 0, 3);

            LangProfile profile_fr = new LangProfile("fr");

            foreach (string w in TRAINING_FR.Split(" "))
            {
                profile_fr.Add(w);
            }
            DetectorFactory.AddProfile(profile_fr, 1, 3);

            LangProfile profile_ja = new LangProfile("ja");

            foreach (string w in TRAINING_JA.Split(" "))
            {
                profile_ja.Add(w);
            }
            DetectorFactory.AddProfile(profile_ja, 2, 3);
        }
Esempio n. 2
0
        public void testFactoryFromJsonString()
        {
            DetectorFactory.Clear();
            List <string> profiles = new List <string>();

            profiles.Add(JSON_LANG1);
            profiles.Add(JSON_LANG2);
            DetectorFactory.LoadProfile(profiles);
            IList <string> langList = DetectorFactory.GetLangList();

            Assert.AreEqual(langList.Count, 2);
            Assert.AreEqual(langList[0], "lang1");
            Assert.AreEqual(langList[1], "lang2");
        }