Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4026566

java.text.TextBoundary#getSentenceBreak() splits sentences at wrong position

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.1
    • core-libs
    • None
    • x86
    • windows_95



      Name: el35337 Date: 01/17/97

      The following code must prints "1\u884c\n". But it prints "1\n\u884c\n".
          The sequence of digit character before cjk character is split in JDK1.1Beta2,
          but it must not be split.
      --------------------------------
      import java.text.*;
      import java.util.*;
      class BTest {
          public static void main(String args[]) {
          String stringToExamine = "1\u884c";
          TextBoundary boundary = TextBoundary.getSentenceBreak();
          boundary.setText(stringToExamine);
          printEachForward(boundary);
          }

          public static void printEachForward(TextBoundary boundary) {
          int start = boundary.first();
          for (int end = boundary.next();
               end != TextBoundary.DONE;
               start = end, end = boundary.next()) {
              System.out.println(boundary.getText().substring(start, end));
          }
          }
      }
      --------------------------------
      (OS is win95 Japanese) ###@###.###

      ======================================================================

            ssenthilsunw Shanmugam Senthil (Inactive)
            elarsen Erik Larsen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: