static public Range GetAllByChar(CodePoint cp) { int b, e; _charIdx.EqualRange(cp, out b, out e); return(new Range((ushort)b, (ushort)e)); }
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); }
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); }