示例#1
0
文件: Partitions.cs 项目: kzyg/spark
        private void DoSingleton(int ch)
        {
            if (partition.bSingletons[(int)ch] != partition.tSingletons[(int)ch])
            {
                throw new GplexInternalException("BitArray and TreeSet not synchronized");
            }
            if (!partition.tSingletons[(int)ch])
            {
                partition.bSingletons[(int)ch] = true; // Keep bitset and tree synchronized

                partition.tSingletons[(int)ch] = true;
                partition.Refine(new RangeLiteral(ch));
            }
        }
示例#2
0
        // Refine based on a single, isolated character.
        // The singleton is transformed into a RangeLiteral with just
        // one element in its RangeList, with a one-length range.
        private void DoSingleton(int ch)
        {
#if DEBUG
            char c = (char)ch; // For readability
#endif
            if (this.partition.myTask.CaseAgnostic)
            {
                partition.Refine(RangeLiteral.NewCaseAgnosticPair(ch));
            }
            else
            {
                partition.Refine(new RangeLiteral(ch));
            }
        }