Unicode.SentenceBreak (Unicode v1.21.0)

View Source

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

Summary

Functions

Returns a map of aliases for Unicode sentence breaks.

Returns the count of the number of characters for a given sentence break.

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

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

Returns a list of known Unicode sentence break names.

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

Returns the map of Unicode sentence breaks.

Functions

aliases()

Returns a map of aliases for Unicode sentence breaks.

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

count(sentence_break)

Returns the count of the number of characters for a given sentence break.

Example

iex> Unicode.SentenceBreak.count(:extend)
2643

fetch(sentence_break)

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

Aliases are resolved by this function.

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

get(sentence_break)

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

Aliases are resolved by this function.

Returns either range_list or nil.

known_sentence_breaks()

Returns a list of known Unicode sentence break names.

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

sentence_break(string)

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

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

For a binary a list of distinct sentence break names represented by the graphemes in the binary is returned.

sentence_breaks()

Returns the map of Unicode sentence breaks.

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