sombok 2.4.0
break

Perform line breaking algorithm. More...

Collaboration diagram for break:

Data Structures

struct  unistr_t
struct  gcstring_t

Functions

propval_t linebreak_lbrule (propval_t b_idx, propval_t a_idx)
 IF_NULL_THEN_ABORT (r=realloc(results, sizeof(gcstring_t *) *(reslen+2)))
 IF_NULL_THEN_ABORT (s=_format(lbobj, LINEBREAK_STATE_LINE, bufStr))
 IF_NULL_THEN_ABORT (t=_format(lbobj, LINEBREAK_STATE_EOT, bufSpc))
 IF_NULL_THEN_ABORT (results[reslen]=gcstring_concat(s, t))
 gcstring_DESTROY (s)
 gcstring_DESTROY (t)
 gcstring_DESTROY (str)
 gcstring_DESTROY (bufStr)
 gcstring_DESTROY (bufSpc)
 linebreak_reset (lbobj)
 if (lenp !=NULL)
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)
gcstring_t ** linebreak_break_partial (linebreak_t *, unistr_t *)

Variables

 results = r)[reslen + 1] = NULL
 reslen

Detailed Description

Perform line breaking algorithm.

Function Documentation

◆ gcstring_DESTROY() [1/5]

gcstring_DESTROY ( bufSpc )

◆ gcstring_DESTROY() [2/5]

gcstring_DESTROY ( bufStr )

◆ gcstring_DESTROY() [3/5]

gcstring_DESTROY ( s )

◆ gcstring_DESTROY() [4/5]

gcstring_DESTROY ( str )

◆ gcstring_DESTROY() [5/5]

gcstring_DESTROY ( t )

◆ if()

if ( lenp ! = NULL)

◆ IF_NULL_THEN_ABORT() [1/4]

IF_NULL_THEN_ABORT ( r = realloc(results, sizeof(gcstring_t *) *(reslen+2)))

◆ IF_NULL_THEN_ABORT() [2/4]

IF_NULL_THEN_ABORT ( results [reslen] = gcstring_concat(s, t))

◆ IF_NULL_THEN_ABORT() [3/4]

IF_NULL_THEN_ABORT ( s = _format(lbobj, LINEBREAK_STATE_LINE, bufStr))

◆ IF_NULL_THEN_ABORT() [4/4]

IF_NULL_THEN_ABORT ( t = _format(lbobj, LINEBREAK_STATE_EOT, bufSpc))

◆ linebreak_break()

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.

◆ linebreak_break_fast()

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.

◆ linebreak_break_from_utf8()

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.

◆ linebreak_break_partial()

gcstring_t ** linebreak_break_partial ( linebreak_t * lbobj,
unistr_t * input )
extern

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.

◆ linebreak_free_result()

void linebreak_free_result ( gcstring_t ** result,
int deep )

◆ linebreak_lbrule()

propval_t linebreak_lbrule ( propval_t b_idx,
propval_t a_idx )
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().

◆ linebreak_reset()

linebreak_reset ( lbobj )

Variable Documentation

◆ reslen

reslen

◆ results

results = r)[reslen + 1] = NULL