Class: CharacterDefinition

CharacterDefinition


new CharacterDefinition()

CharacterDefinition represents char.def file and defines behavior of unknown word processing

Methods


<static> load(cat_map_buffer, compat_cat_map_buffer, invoke_def_buffer)

Load CharacterDefinition

Parameters:
Name Type Description
cat_map_buffer Uint8Array
compat_cat_map_buffer Uint32Array
invoke_def_buffer InvokeDefinitionMap
Returns:
Type
CharacterDefinition

initCategoryMappings(category_mapping)

Initializing method

Parameters:
Name Type Description
category_mapping Array

Array of category mapping


lookup(ch)

Lookup category for a character

Parameters:
Name Type Description
ch string

UCS2 character (just 1st character is effective)

Returns:

character class

Type
CharacterClass

lookupCompatibleCategory(ch)

Lookup compatible categories for a character (not included 1st category)

Parameters:
Name Type Description
ch string

UCS2 character (just 1st character is effective)

Returns:

character classes

Type
Array.<CharacterClass>