Ejemplo n.º 1
0
        public void 通常()
        {
            var token = new MathObjectFactory("F").Create().TestSingle();

            token.IsMathToken("F");
            token.ToTokenString().TestString("F");
            token.OriginalText.Is("F");

            var math = CreateSingleSequence("Fg");

            math.List.Count.Is(2);
            math.List[0].IsMathToken("F");
            math.List[1].IsMathToken("g");
            math.Sup.IsNull();
            math.Sub.IsNull();
            math.Main.TestString("Fg");
            math.ToTokenString().TestString("Fg");

            math = CreateSingleSequence("abcdefg");
            math.List.Count.Is(7);
            math.List[0].IsMathToken("a");
            math.List[1].IsMathToken("b");
            math.List[2].IsMathToken("c");
            math.List[3].IsMathToken("d");
            math.List[4].IsMathToken("e");
            math.List[5].IsMathToken("f");
            math.List[6].IsMathToken("g");
            math.Sup.IsNull();
            math.Sub.IsNull();
            math.Main.TestString("abcdefg");
            math.ToTokenString().TestString("abcdefg");
            math.OriginalText.Is("abcdefg");
        }
Ejemplo n.º 2
0
        public void  数1()
        {
            var token = new MathObjectFactory("#1").Create().TestSingle();

            token.IsMathToken("#1");
            token.OriginalText.Is("#1");

            token = new MathObjectFactory("#1?").Create().TestSingle();
            token.IsMathToken("#1?");
            token.OriginalText.Is("#1?");

            token = new MathObjectFactory("#1s").Create().TestSingle();
            token.IsMathToken("#1s");
            token.OriginalText.Is("#1s");

            token = new MathObjectFactory("#1t").Create().TestSingle();
            token.IsMathToken("#1t");
            token.OriginalText.Is("#1t");

            var math = CreateSingleSequence("#1#2");

            math.List.Count.Is(2);
            math.List[0].IsMathToken("#1");
            math.List[1].IsMathToken("#2");
            math.Main.TestString("#1#2");
            math.ToTokenString().TestString("#1#2");

            math = CreateSingleSequence("#1#2?");
            math.List.Count.Is(2);
            math.List[0].IsMathToken("#1");
            math.List[1].IsMathToken("#2?");
            math.Main.TestString("#1#2?");
            math.ToTokenString().TestString("#1#2?");

            math = CreateSingleSequence("#1u");
            math.List.Count.Is(2);
            math.List[0].IsMathToken("#1");
            math.List[1].IsMathToken("u");
            math.Main.TestString("#1 u");
            math.ToTokenString().TestString("#1u");

            math = CreateSingleSequence("abc_{#1?}");
            math.List.Count.Is(3);
            math.List[0].IsMathToken("a");
            math.List[1].IsMathToken("b");
            math.List[2].Main.TestString("c");
            math.List[2].AsMathSequence().Sup.IsNull();
            math.List[2].AsMathSequence().Sub.IsMathToken("#1?");
            math.Main.TestString("abc_{#1?}");
            math.ToTokenString().TestString("abc_{#1?}");
        }
Ejemplo n.º 3
0
        public void TeXコマンド()
        {
            var token = new MathObjectFactory(@"\theta").Create().TestSingle();

            token.IsMathToken(@"\theta");
            token.ToTokenString().TestString(@"\theta");
            token.OriginalText.Is(@"\theta");

            var math = CreateSingleSequence(@"F\theta");

            math.List.Count.Is(2);
            math.List[0].IsMathToken("F");
            math.List[1].IsMathToken(@"\theta");
            math.Main.TestString(@"F\theta");
            math.ToTokenString().TestString(@"F\theta");
            math.OriginalText.Is(@"F\theta");

            math = CreateSingleSequence(@"\cat{C}");
            math.List.Count.Is(2);
            math.List[0].IsMathToken(@"\cat");
            math.List[1].AsMathSequence().List.Count.Is(1);
            math.List[1].AsMathSequence().List[0].IsMathToken("C");
            math.List[1].AsMathSequence().LeftBracket.TestToken("{");
            math.List[1].AsMathSequence().RightBracket.TestToken("}");
            math.List[1].ToTokenString().TestString("{C}");
            math.Main.TestString(@"\cat{C}");
            math.ToTokenString().TestString(@"\cat{C}");
            math.OriginalText.Is(@"\cat{C}");

            math = CreateSingleSequence(@"\encat{C}\otimes\encat{D}");
            math.List.Count.Is(5);
            math.List[0].IsMathToken("\\encat");
            math.List[1].AsMathSequence().List.Count.Is(1);
            math.List[1].AsMathSequence().List[0].IsMathToken("C");
            math.List[1].AsMathSequence().LeftBracket.TestToken("{");
            math.List[1].AsMathSequence().RightBracket.TestToken("}");
            math.List[2].IsMathToken("\\otimes");
            math.List[3].IsMathToken("\\encat");
            math.List[4].AsMathSequence().List.Count.Is(1);
            math.List[4].AsMathSequence().List[0].IsMathToken("D");
            math.List[4].AsMathSequence().LeftBracket.TestToken("{");
            math.List[4].AsMathSequence().RightBracket.TestToken("}");
            math.Main.TestString(@"\encat{C}\otimes\encat{D}");
            math.ToTokenString().TestString(@"\encat{C}\otimes\encat{D}");
            math.OriginalText.Is(@"\encat{C}\otimes\encat{D}");
        }