Esempio n. 1
0
        private bool CompareGroup(List <T_WordInfo> words, List <int> pre, List <int> cur, T_Direction direction)
        {
            int i;

            if (direction == T_Direction.LeftToRight)
            {
                i = 0;
            }
            else
            {
                i = cur.Count - 1;
            }


            while ((direction == T_Direction.LeftToRight && i < cur.Count) ||
                   (direction == T_Direction.RightToLeft && i >= 0))

            {
                if (i >= pre.Count)
                {
                    break;
                }

                int preId = (int)pre[i];
                int curId = (int)cur[i];

                if (((T_WordInfo)words[curId]).Word.Length > ((T_WordInfo)words[preId]).Word.Length)
                {
                    return(true);
                }
                else if (((T_WordInfo)words[curId]).Word.Length < ((T_WordInfo)words[preId]).Word.Length)
                {
                    return(false);
                }

                if (direction == T_Direction.LeftToRight)
                {
                    i++;
                }
                else
                {
                    i--;
                }
            }

            return(false);
        }
Esempio n. 2
0
 public CExtractWords()
 {
     _MatchDirection = T_Direction.LeftToRight;
     _WordDfa        = new CWordDfa();
 }