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
string_or_codepoint()
View Sourcestring_or_codepoint() :: String.t() | non_neg_integer()
Link to this section Functions
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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.
properties(string)
View Sourceproperties(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.
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
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