Exemple #1
0
 /// <summary>
 /// For debugging purposes; format the given text in the form
 /// aaa{bbb|ccc|ddd}eee, where the {} indicate the context start and limit,
 /// and the || indicate the start and limit.
 /// </summary>
 ///
 public static StringBuilder FormatInput(StringBuilder appendTo,
                                         ReplaceableString input, Transliterator.Position pos)
 {
     if (0 <= pos.contextStart && pos.contextStart <= pos.start &&
         pos.start <= pos.limit && pos.limit <= pos.contextLimit &&
         pos.contextLimit <= input.Length())
     {
         String b, c, d;
         // a = input.substring(0, pos.contextStart);
         b = input.Substring(pos.contextStart, pos.start);
         c = input.Substring(pos.start, pos.limit);
         d = input.Substring(pos.limit, pos.contextLimit);
         // e = input.substring(pos.contextLimit, input.length());
         appendTo.// append(a).
         Append('{').Append(b).Append('|').Append(c).Append('|').Append(d)
         .Append('}')
         // .append(e)
         ;
     }
     else
     {
         appendTo.Append("INVALID Position {cs=" + pos.contextStart + ", s="
                         + pos.start + ", l=" + pos.limit + ", cl="
                         + pos.contextLimit + "} on " + input);
     }
     return(appendTo);
 }