コード例 #1
0
        public void TestIssue46()
        {
            var seg = new JiebaSegmenter();

            seg.DeleteWord("天半");

            var segments = seg.CutAll("2天半").ToList();

            Assert.That(segments, Contains.Item("天"));
            Assert.That(segments, Contains.Item("半"));
        }
コード例 #2
0
        public void TestCutAllMixedZhEn()
        {
            var seg = new JiebaSegmenter();

            seg.AddWord("超敏C反应蛋白");

            var s        = "很多人的第一门语言是C语言。超敏C反应蛋白是什么?";
            var segments = seg.CutAll(s).ToList();

            Assert.That(segments, Contains.Item("C语言"));
            Console.WriteLine(segments);
            foreach (var sm in segments)
            {
                Console.WriteLine(sm);
            }
        }