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)
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

## 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] | 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()

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] | 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()

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] | 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()

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

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()

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_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().