Ejemplo n.º 1
0
        public int NextState(byte b)
        {
            // for each byte we get its class, if it is first byte,
            // we also get byte length
            int byteCls = model.GetClass(b);

            if (currentState == SMModel.START)
            {
                currentBytePos = 0;
                currentCharLen = model.charLenTable[byteCls];
            }

            // from byte's class and stateTable, we get its next state
            currentState = model.stateTable.Unpack(
                currentState * model.ClassFactor + byteCls);
            currentBytePos++;
            return(currentState);
        }