Perform line breaking algorithm.
More...
|
| 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 *) |
Perform line breaking algorithm.
◆ gcstring_DESTROY() [1/5]
| gcstring_DESTROY |
( |
bufSpc | | ) |
|
◆ gcstring_DESTROY() [2/5]
| gcstring_DESTROY |
( |
bufStr | | ) |
|
◆ gcstring_DESTROY() [3/5]
◆ gcstring_DESTROY() [4/5]
◆ gcstring_DESTROY() [5/5]
◆ if()
◆ IF_NULL_THEN_ABORT() [1/4]
◆ IF_NULL_THEN_ABORT() [2/4]
◆ IF_NULL_THEN_ABORT() [3/4]
◆ IF_NULL_THEN_ABORT() [4/4]
◆ linebreak_break()
Perform line breaking algorithm on complete input.
This function will consume constant size of heap.
- Parameters
-
| [in] | lbobj | linebreak object. |
| [in] | input | Unicode 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()
Perform line breaking algorithm on complete input.
This function will consume heap size proportional to input size. linebreak_break() is highly recommended.
- Parameters
-
| [in] | lbobj | linebreak object. |
| [in] | input | Unicode 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()
Perform line breaking algorithm on UTF-8 text
This function will consume constant size of heap.
- Parameters
-
| [in] | lbobj | linebreak object. |
| [in] | input | UTF-8 string, must not be NULL. |
| [in] | len | length of UTF-8 string. |
| [in] | check | check 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()
Perform line breaking algorithm with incremental inputs.
- Parameters
-
| [in] | lbobj | linebreak object. |
| [in] | input | Unicode 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()
- 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_idx | line breaking class. |
| [in] | b_idx | line 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 | | ) |
|
◆ reslen
◆ results
| results = r)[reslen + 1] = NULL |