code: public static StringBuffer formatInput(StringBuffer 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;
      }
docs: 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.