Example #1
0
        public void Test()
        {
            var data = new LanguageData(new LanguageType("tr", "test"))
            {
                OrthographyXml = Resources.orthography,
                MorphotacticsXml = Resources.morphotactics,
                RootTxt = Resources.root,
                SuffixTxt = Resources.suffix
            };

            var reader = new LanguageReader("");
            var lang = reader.Parse(data);

            var solutions = lang.Analyze("kitaplarım");

            Assert.AreEqual(1, solutions.Count);

            var analysis = "kitap/ISIM IC_COGUL_lAr IC_SAHIPLIK_BEN_(U)m";

            var surface = lang.GetWord(analysis).GetSurface();

            Assert.AreEqual("kitaplarım", surface);

            Assert.AreEqual(analysis, solutions.First().ToString());
        }
Example #2
0
        public Language Parse(LanguageData data)
        {
            _orthography = ParseOrthography(data.OrthographyXml);

            var morphotactics = ParseMorphotactics(data.MorphotacticsXml);

            var roots = ParseRoots(data.RootTxt);

            var suffixes = ParseSuffixes(data.SuffixTxt);

            return new Language(data.Type, _orthography, morphotactics, roots, suffixes);
        }