Ejemplo n.º 1
0
        private Sentence JsonSentenceToSentence(List <List <string> > jsonSentence)
        {
            List <Morpheme> morphemes = new List <Morpheme>();

            foreach (List <string> jsonMorpheme in jsonSentence)
            {
                var morpheme = morphemeConversionService.ConvertToMorpheme(jsonMorpheme);
                morphemes.Add(morpheme);
            }

            return(new Sentence(morphemes));
        }
        public void HasPropertiesAfterConvertingToMorpheme()
        {
            var testJsonMorpheme = new List <string>()
            {
                "文章",
                "ブンショウ"
            };
            var result = morphemeConversionService.ConvertToMorpheme(testJsonMorpheme);

            Assert.AreEqual("ブンショウ", result.KatakanaReading);
            Assert.AreEqual(PartOfSpeech.NotRecognized, result.PartOfSpeech);
            Assert.AreEqual("文章", result.Kanji);
        }