示例#1
0
        static public Range GetAllByChar(CodePoint cp)
        {
            int b, e;

            _charIdx.EqualRange(cp, out b, out e);
            return(new Range((ushort)b, (ushort)e));
        }
示例#2
0
 public void TestAI()
 {
     var ai = new ArrayIndex<CodePoint,int>{{'這',1},{'在',2},{'謟',5},{'謟',0},{'A',3}};
     ai.Prep();
     Assert.AreEqual(5,ai.Length);
     int b = 0, e = ai.Length;
     ai.EqualRange('謟',out b,out e);
     Assert.AreNotEqual(b,e);
     Assert.True(e>b);
 }
示例#3
0
        public void TestAI()
        {
            var ai = new ArrayIndex <CodePoint, int> {
                { '這', 1 }, { '在', 2 }, { '謟', 5 }, { '謟', 0 }, { 'A', 3 }
            };

            ai.Prep();
            Assert.AreEqual(5, ai.Length);
            int b = 0, e = ai.Length;

            ai.EqualRange('謟', out b, out e);
            Assert.AreNotEqual(b, e);
            Assert.True(e > b);
        }