NFKC

public class NFKC

This class offers static methods for Unicode NFKC string normalization.

Fields

LBase

static final int LBase

LCount

static final int LCount

NCount

static final int NCount

SBase

static final int SBase

Entire hangul code copied from: http://www.unicode.org/unicode/reports/tr15/ Several hangul specific constants

SCount

static final int SCount

TBase

static final int TBase

TCount

static final int TCount

VBase

static final int VBase

VCount

static final int VCount

Methods

canonicalOrdering

static void canonicalOrdering(StringBuffer in)

Rearranges characters in a stringbuffer in order to respect the canonical ordering properties.

Parameters:
  • The – StringBuffer to rearrange.

combiningClass

static int combiningClass(char c)

Returns the combining class of a given character.

Parameters:
  • c – The character.
Returns:

The combining class.

compose

static int compose(char a, char b)

Tries to compose two characters canonically.

Parameters:
  • a – First character.
  • b – Second character.
Returns:

The composed character or -1 if no composition could be found.

composeHangul

static int composeHangul(char a, char b)

Composes two hangul characters.

Parameters:
  • a – First character.
  • b – Second character.
Returns:

Returns the composed character or -1 if the two characters cannot be composed.

composeIndex

static int composeIndex(char a)

Returns the index inside the composition table.

Parameters:
  • a – Character to look up.
Returns:

Index if found, -1 otherwise.

decomposeHangul

static String decomposeHangul(char s)

Decomposes a hangul character.

Parameters:
  • s – A character to decompose.
Returns:

A string containing the hangul decomposition of the input character. If no hangul decomposition can be found, a string containing the character itself is returned.

decomposeIndex

static int decomposeIndex(char c)

Returns the index inside the decomposition table, implemented using a binary search.

Parameters:
  • c – Character to look up.
Returns:

Index if found, -1 otherwise.

normalizeNFKC

public static String normalizeNFKC(String in)

Applies NFKC normalization to a string.

Parameters:
  • in – The string to normalize.
Returns:

An NFKC normalized string.