Пример #1
0
        public IEnumerable <BreakSpan> GetBreakSpanIter()
        {
            List <int> breakAtList = visitor.GetBreakList();
            int        c_index     = 0;
            int        i           = 0;

            foreach (int breakAt in breakAtList)
            {
                BreakSpan sp = new BreakSpan();
                sp.startAt = c_index;
                sp.len     = breakAtList[i] - c_index;
                c_index   += sp.len;
                i++;
                yield return(sp);
            }
            //-------------------
            if (c_index < textLength)
            {
                BreakSpan sp = new BreakSpan();
                sp.startAt = c_index;
                sp.len     = textLength - c_index;
                yield return(sp);
            }
        }
Пример #2
0
 public IEnumerable<BreakSpan> GetBreakSpanIter()
 {
     List<int> breakAtList = visitor.GetBreakList();
     int c_index = 0;
     int i = 0;
     foreach (int breakAt in breakAtList)
     {
         BreakSpan sp = new BreakSpan();
         sp.startAt = c_index;
         sp.len = breakAtList[i] - c_index;
         c_index += sp.len;
         i++;
         yield return sp;
     }
     //-------------------
     if (c_index < textLength)
     {
         BreakSpan sp = new BreakSpan();
         sp.startAt = c_index;
         sp.len = textLength - c_index;
         yield return sp;
     }
 }