Unicode.LineBreak (Unicode v1.21.0)

View Source

Functions to introspect Unicode line breaks for binaries (Strings) and codepoints.

Summary

Functions

Returns a map of aliases for Unicode line breaks.

Returns the count of the number of characters for a given line_break.

Returns the Unicode ranges for a given line break as a list of ranges as 2-tuples.

Returns the Unicode ranges for a given line break as a list of ranges as 2-tuples.

Returns a list of known Unicode line break names.

Returns the line break name(s) for the given binary or codepoint.

Returns the map of Unicode line breaks.

Functions

aliases()

Returns a map of aliases for Unicode line breaks.

An alias is an alternative name for referring to a line break. Aliases are resolved by the fetch/1 and get/1 functions.

count(line_break)

Returns the count of the number of characters for a given line_break.

Example

iex> Unicode.LineBreak.count(:al)
26954

fetch(line_break)

Returns the Unicode ranges for a given line break as a list of ranges as 2-tuples.

Aliases are resolved by this function.

Returns either {:ok, range_list} or :error.

get(line_break)

Returns the Unicode ranges for a given line break as a list of ranges as 2-tuples.

Aliases are resolved by this function.

Returns either range_list or nil.

known_line_breaks()

Returns a list of known Unicode line break names.

This function does not return the names of any line break aliases.

line_break(string)

Returns the line break name(s) for the given binary or codepoint.

In the case of a codepoint, a single line_break name is returned.

For a binary a list of distinct line break names represented by the lines in the binary is returned.

line_breaks()

Returns the map of Unicode line breaks.

The line break name is the map key and a list of codepoint ranges as tuples as the value.