sombok  2.2.1
Data Structures | Functions
break

Perform line breaking algorithm. More...

Data Structures

struct  unistr_t
struct  gcstring_t

Functions

propval_t linebreak_lbrule (propval_t b_idx, propval_t a_idx)
gcstring_t ** linebreak_break_partial (linebreak_t *lbobj, unistr_t *input)
gcstring_t ** linebreak_break_fast (linebreak_t *lbobj, unistr_t *input)
gcstring_t ** linebreak_break (linebreak_t *lbobj, unistr_t *input)
gcstring_t ** linebreak_break_from_utf8 (linebreak_t *lbobj, char *input, size_t len, int check)
void linebreak_free_result (gcstring_t **result, int deep)

Detailed Description

Perform line breaking algorithm.


Function Documentation

gcstring_t** linebreak_break ( linebreak_t lbobj,
unistr_t input 
)

Perform line breaking algorithm on complete input.

This function will consume constant size of heap.

Parameters:
[in]lbobjlinebreak object.
[in]inputUnicode string.
Returns:
array of broken grapheme cluster strings terminated by NULL. If internal error occurred, lbobj->errnum is set then NULL is returned.
gcstring_t** linebreak_break_fast ( linebreak_t lbobj,
unistr_t input 
)

Perform line breaking algorithm on complete input.

This function will consume heap size proportional to input size. linebreak_break() is highly recommended.

Parameters:
[in]lbobjlinebreak object.
[in]inputUnicode string.
Returns:
array of broken grapheme cluster strings terminated by NULL. If internal error occurred, lbobj->errnum is set then NULL is returned.
gcstring_t** linebreak_break_from_utf8 ( linebreak_t lbobj,
char *  input,
size_t  len,
int  check 
)

Perform line breaking algorithm on UTF-8 text

This function will consume constant size of heap.

Parameters:
[in]lbobjlinebreak object.
[in]inputUTF-8 string, must not be NULL.
[in]lenlength of UTF-8 string.
[in]checkcheck input. See sombok_decode_utf8().
Returns:
array of broken grapheme cluster strings terminated by NULL. If internal error occurred, lbobj->errnum is set then NULL is returned.
gcstring_t ** linebreak_break_partial ( linebreak_t lbobj,
unistr_t input 
)

Perform line breaking algorithm with incremental inputs.

Parameters:
[in]lbobjlinebreak object.
[in]inputUnicode string; give NULL to specify end of input.
Returns:
array of (partial) broken grapheme cluster strings terminated by NULL. If internal error occurred, lbobj->errnum is set then NULL is returned.
void linebreak_free_result ( gcstring_t **  result,
int  deep 
)
Deprecated:
Use linebreak_get_lbrule().

Get breaking rule between two classes

From given two line breaking classes, get breaking rule determined by internal data.

Parameters:
[in]a_idxline breaking class.
[in]b_idxline breaking class.
Returns:
line breaking action: MANDATORY, DIRECT, INDIRECT or PROHIBITED. If action was not determined, returns DIRECT.
Note:
This method gives just approximate description of line breaking behavior. Especially, it won't give meaningful value related to classes AI and CJ. See also linebreak_get_lbrule().