Unicode v1.1.0 Unicode.Property View Source

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

Link to this section Summary

Functions

Returns :alphabetic or nil based upon whether the given codepoint or binary is all alphabetic characters.

Returns a boolean based upon whether the given codepoint or binary is all alphabetic characters.

Returns :alphanumeric or nil based upon whether the given codepoint or binary is all alphanumeric characters.

Returns a boolean based upon whether the given codepoint or binary is all alphanumeric characters.

Returns :case_ignorable or nil based upon whether the given codepoint or binary is all case ignorable characters.

Returns a boolean based upon whether the given codepoint or binary is all case ignorable characters.

Returns :cased or nil based upon whether the given codepoint or binary is all cased characters.

Returns a boolean based upon whether the given codepoint or binary is all cased characters.

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

Returns a boolean based upon whether the given codepoint or binary is all emoji characters.

Returns :extended_numeric or nil based upon whether the given codepoint or binary is all alphanumeric characters.

Returns a boolean based upon whether the given codepoint or binary is all numberic characters.

Returns a list of known Unicode property names.

Returns :lowercase or nil based upon whether the given codepoint or binary is all lowercase characters.

Returns a boolean based upon whether the given codepoint or binary is all lowercase characters.

Returns :math or nil based upon whether the given codepoint or binary is all math characters.

Returns a boolean based upon whether the given codepoint or binary is all math characters.

Returns :numeric or nil based upon whether the given codepoint or binary is all numeric characters.

Returns a boolean based upon whether the given codepoint or binary is all numeric characters.

Returns the map of Unicode properties.

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

Returns :uppercase or nil based upon whether the given codepoint or binary is all uppercase characters.

Returns a boolean based upon whether the given codepoint or binary is all uppercase characters.

Link to this section Types

Link to this type

string_or_codepoint()

View Source
string_or_codepoint() :: String.t() | non_neg_integer()

Link to this section Functions

Link to this function

alphabetic(codepoint_or_binary)

View Source

Returns :alphabetic or nil based upon whether the given codepoint or binary is all alphabetic characters.

This is useful when the desired result is truthy or falsy

Example

iex> Unicode.Property.alphabetic "abc"
:alphabetic
iex> Unicode.Property.alphabetic "123"
nil
Link to this function

alphabetic?(codepoint_or_binary)

View Source

Returns a boolean based upon whether the given codepoint or binary is all alphabetic characters.

Example

iex> Unicode.Property.alphabetic? "abc"
true
iex> Unicode.Property.alphabetic? "123"
false
Link to this function

alphanumeric(codepoint_or_binary)

View Source

Returns :alphanumeric or nil based upon whether the given codepoint or binary is all alphanumeric characters.

This is useful when the desired result is truthy or falsy

Example

iex> Unicode.Property.alphanumeric "123abc"
:alphanumeric
iex> Unicode.Property.alphanumeric "???"
nil
Link to this function

alphanumeric?(codepoint_or_binary)

View Source

Returns a boolean based upon whether the given codepoint or binary is all alphanumeric characters.

Example

iex> Unicode.Property.alphanumeric? "123abc"
true
iex> Unicode.Property.alphanumeric? "⅔"
false
Link to this function

case_ignorable(codepoint_or_binary)

View Source

Returns :case_ignorable or nil based upon whether the given codepoint or binary is all case ignorable characters.

This is useful when the desired result is truthy or falsy

Example

iex> Unicode.Property.case_ignorable ".:^"
:case_ignorable
iex> Unicode.Property.case_ignorable "123abc"
nil
Link to this function

case_ignorable?(codepoint_or_binary)

View Source

Returns a boolean based upon whether the given codepoint or binary is all case ignorable characters.

Example

iex> Unicode.Property.case_ignorable? ".:^"
true
iex> Unicode.Property.case_ignorable? "123abc"
false
Link to this function

cased(codepoint_or_binary)

View Source

Returns :cased or nil based upon whether the given codepoint or binary is all cased characters.

This is useful when the desired result is truthy or falsy

Example

iex> Unicode.Property.cased "abc"
:cased
iex> Unicode.Property.cased "123"
nil
Link to this function

cased?(codepoint_or_binary)

View Source

Returns a boolean based upon whether the given codepoint or binary is all cased characters.

Example

iex> Unicode.Property.cased? "abc"
true
iex> Unicode.Property.cased? "123"
false

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

Example

iex> Unicode.Property.count(:lowercase)
2340
Link to this function

default_ignorable_code_point(codepoint)

View Source
Link to this function

default_ignorable_code_point?(codepoint)

View Source
Link to this function

emoji?(codepoint_or_binary)

View Source

Returns a boolean based upon whether the given codepoint or binary is all emoji characters.

Note that some characters are unexpectedly emoji because they are part of a multicodepoint combination. For example, the numbers 0 through 9 are emoji because they form part of the keycap emoji codepoints.

Example

iex> Unicode.Property.emoji? "🔥"
true
iex> Unicode.Property.emoji? "1"
true
iex> Unicode.Property.emoji? "abc"
false
Link to this function

extended_numeric(codepoint_or_binary)

View Source

Returns :extended_numeric or nil based upon whether the given codepoint or binary is all alphanumeric characters.

Extended numberic includes fractions, superscripts, subscripts and other characters in the category No.

This is useful when the desired result is truthy or falsy

Example

iex> Unicode.Property.extended_numeric "123"
:extended_numeric
iex> Unicode.Property.extended_numeric "⅔"
:extended_numeric
iex> Unicode.Property.extended_numeric "-123"
nil
Link to this function

extended_numeric?(codepoint_or_binary)

View Source

Returns a boolean based upon whether the given codepoint or binary is all numberic characters.

Example

iex> Unicode.Property.extended_numeric? "123" true iex> Unicode.Property.extended_numeric? "⅔" true

Returns a list of known Unicode property names.

This function does not return the names of any property aliases.

Link to this function

lowercase(codepoint_or_binary)

View Source

Returns :lowercase or nil based upon whether the given codepoint or binary is all lowercase characters.

This is useful when the desired result is truthy or falsy

Example

iex> Unicode.Property.lowercase "abc"
:lowercase
iex> Unicode.Property.lowercase "ABC"
nil
Link to this function

lowercase?(codepoint_or_binary)

View Source

Returns a boolean based upon whether the given codepoint or binary is all lowercase characters.

Example

iex> Unicode.Property.lowercase? "abc"
true
iex> Unicode.Property.lowercase? "ABC"
false
Link to this function

math(codepoint_or_binary)

View Source

Returns :math or nil based upon whether the given codepoint or binary is all math characters.

This is useful when the desired result is truthy or falsy

Example

iex> Unicode.Property.math "+<>=^"
:math
iex> Unicode.Property.math "*/"
nil
Link to this function

math?(codepoint_or_binary)

View Source

Returns a boolean based upon whether the given codepoint or binary is all math characters.

Example

iex> Unicode.Property.math? "+<>^"
true
iex> Unicode.Property.math? "abc"
false
Link to this function

numeric(codepoint_or_binary)

View Source

Returns :numeric or nil based upon whether the given codepoint or binary is all numeric characters.

This is useful when the desired result is truthy or falsy

Example

iex> Unicode.Property.numeric "123"
:numeric
iex> Unicode.Property.numeric "123a"
nil

Returns a boolean based upon whether the given codepoint or binary is all numeric characters.

Example

iex> Unicode.Property.numeric? "123"
true
iex> Unicode.Property.numeric? "123a"
false

Returns the map of Unicode properties.

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

Link to this function

properties(string)

View Source
properties(string_or_codepoint()) :: [atom(), ...] | [[atom(), ...], ...]

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

In the case of a codepoint, a single list of properties for that codepoint name is returned.

For a binary a list of list for each codepoint in the binary is returned.

Link to this function

uppercase(codepoint_or_binary)

View Source

Returns :uppercase or nil based upon whether the given codepoint or binary is all uppercase characters.

This is useful when the desired result is truthy or falsy

Example

iex> Unicode.Property.uppercase "ABC"
:uppercase
iex> Unicode.Property.uppercase "abc"
nil
Link to this function

uppercase?(codepoint_or_binary)

View Source

Returns a boolean based upon whether the given codepoint or binary is all uppercase characters.

Example

iex> Unicode.Property.uppercase? "ABC"
true
iex> Unicode.Property.uppercase? "abc"
false