Delta() 공개 메소드

public Delta ( int state, int c ) : int
state int
c int
리턴 int
예제 #1
0
        public static IEnumerable <char> Transduce(IEnumerable <char> input)
        {
            var encoder = new UTF8Encoder();
            int state   = encoder.q0;

            foreach (char c in input)
            {
                foreach (char d in encoder.Psi(state, (int)c))
                {
                    yield return(d);
                }
                state = encoder.Delta(state, (int)c);
            }
            if (encoder.F.Contains(state))
            {
                foreach (char d in encoder.Psi(state, -1))
                {
                    yield return(d);
                }
            }
            else
            {
                throw new Exception("UTF8Encoder");
            }
        }
예제 #2
0
 public static IEnumerable<char> Transduce(IEnumerable<char> input)
 {
     var encoder = new UTF8Encoder();
     int state = encoder.q0;
     foreach (char c in input)
     {
       foreach (char d in encoder.Psi(state, (int)c))
     yield return d;
       state = encoder.Delta(state, (int)c);
     }
     if (encoder.F.Contains(state))
     {
       foreach (char d in encoder.Psi(state, -1))
     yield return d;
     }
     else
       throw new Exception("UTF8Encoder");
 }