FileDocCategorySizeDatePackage
HangulTextBoundaryDetection.javaAPI DocExample979Fri Mar 30 00:12:50 BST 2001None

HangulTextBoundaryDetection

public class HangulTextBoundaryDetection extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] s)

    // we create a string composed of 6 jamo
    String hangul = "\u1112\u1161\u11ab\u1100\u1173\u11af";

    // Retreive a character and a word BreakIterator object
    // that is locale-sensitive for Korean text.
    BreakIterator ci = BreakIterator.getCharacterInstance(Locale.KOREAN);
    BreakIterator wi = BreakIterator.getWordInstance(Locale.KOREAN);

    System.out.print("Character Boundaries: ");
    printBoundaries(hangul, ci);
    System.out.print("\nWord Boundaries:");
    printBoundaries(hangul, wi);
  
static voidprintBoundaries(java.lang.String source, java.text.BreakIterator bi)

    bi.setText(source);
    int boundary = bi.first();

    while (boundary != BreakIterator.DONE) {
      System.out.print(boundary + " ");
      boundary = bi.next();
    }