protocol
text_normalizer_protocol
Text normalization protocol for text represented as atoms, lists of characters, or lists of character codes.
logtalk_load(text_normalization(loader))staticPublic predicates
normalize_unicode/3
Normalizes text to the specified Unicode normalization form. Valid forms are nfc, nfd, nfkc, and nfkd.
staticnormalize_unicode(Form,Text,Normalized)normalize_unicode(+atom,+text,-text) - one_or_errorRepresentation parameter is a variable:instantiation_errorRepresentation parameter is neither a variable nor atom, chars, or codes:domain_error(text_representation,Representation)Profile parameter is a variable:instantiation_errorProfile parameter neither a variable nor an object identifier:type_error(object_identifier,Profile)Profile parameter is an object identifier but not an object conforming to text_normalization_profile_protocol:domain_error(text_normalization_profile,Profile)Form is a variable:instantiation_errorForm is not an atom:type_error(atom,Form)Form is not a supported Unicode normalization form:domain_error(unicode_normalization_form,Form)Text is not ground:instantiation_errorRepresentation parameter is atom but Text is not an atom:type_error(atom,Text)Representation parameter is chars but Text is not a list of characters:type_error(chars,Text)Representation parameter is codes but Text is not a list of character codes:type_error(codes,Text)domain_error(unicode_scalar_value,Code)remove_diacritics/2
Canonically decomposes text, removes Unicode mark characters, and returns NFC text.
staticremove_diacritics(Text,Normalized)remove_diacritics(+text,-text) - one_or_errorRepresentation parameter is a variable:instantiation_errorRepresentation parameter is neither a variable nor atom, chars, or codes:domain_error(text_representation,Representation)Profile parameter is a variable:instantiation_errorProfile parameter neither a variable nor an object identifier:type_error(object_identifier,Profile)Profile parameter is an object identifier but not an object conforming to text_normalization_profile_protocol:domain_error(text_normalization_profile,Profile)Text is not ground:instantiation_errorRepresentation parameter is atom but Text is not an atom:type_error(atom,Text)Representation parameter is chars but Text is not a list of characters:type_error(chars,Text)Representation parameter is codes but Text is not a list of character codes:type_error(codes,Text)domain_error(unicode_scalar_value,Code)fold_diacritics/2
Removes diacritics and applies profile-defined transliterations for characters without canonical decompositions.
staticfold_diacritics(Text,Normalized)fold_diacritics(+text,-text) - one_or_errorRepresentation parameter is a variable:instantiation_errorRepresentation parameter is neither a variable nor atom, chars, or codes:domain_error(text_representation,Representation)Profile parameter is a variable:instantiation_errorProfile parameter neither a variable nor an object identifier:type_error(object_identifier,Profile)Profile parameter is an object identifier but not an object conforming to text_normalization_profile_protocol:domain_error(text_normalization_profile,Profile)Text is not ground:instantiation_errorRepresentation parameter is atom but Text is not an atom:type_error(atom,Text)Representation parameter is chars but Text is not a list of characters:type_error(chars,Text)Representation parameter is codes but Text is not a list of character codes:type_error(codes,Text)domain_error(unicode_scalar_value,Code)case_fold/2
Applies full default Unicode case folding, unless overridden by the selected profile.
staticcase_fold(Text,Folded)case_fold(+text,-text) - one_or_errorRepresentation parameter is a variable:instantiation_errorRepresentation parameter is neither a variable nor atom, chars, or codes:domain_error(text_representation,Representation)Profile parameter is a variable:instantiation_errorProfile parameter neither a variable nor an object identifier:type_error(object_identifier,Profile)Profile parameter is an object identifier but not an object conforming to text_normalization_profile_protocol:domain_error(text_normalization_profile,Profile)Text is not ground:instantiation_errorRepresentation parameter is atom but Text is not an atom:type_error(atom,Text)Representation parameter is chars but Text is not a list of characters:type_error(chars,Text)Representation parameter is codes but Text is not a list of character codes:type_error(codes,Text)domain_error(unicode_scalar_value,Code)lower_case/2
Converts text to lowercase using the selected profile and Unicode default casing.
staticlower_case(Text,Lowercase)lower_case(+text,-text) - one_or_errorRepresentation parameter is a variable:instantiation_errorRepresentation parameter is neither a variable nor atom, chars, or codes:domain_error(text_representation,Representation)Profile parameter is a variable:instantiation_errorProfile parameter neither a variable nor an object identifier:type_error(object_identifier,Profile)Profile parameter is an object identifier but not an object conforming to text_normalization_profile_protocol:domain_error(text_normalization_profile,Profile)Text is not ground:instantiation_errorRepresentation parameter is atom but Text is not an atom:type_error(atom,Text)Representation parameter is chars but Text is not a list of characters:type_error(chars,Text)Representation parameter is codes but Text is not a list of character codes:type_error(codes,Text)domain_error(unicode_scalar_value,Code)upper_case/2
Converts text to uppercase using the selected profile and Unicode default casing.
staticupper_case(Text,Uppercase)upper_case(+text,-text) - one_or_errorRepresentation parameter is a variable:instantiation_errorRepresentation parameter is neither a variable nor atom, chars, or codes:domain_error(text_representation,Representation)Profile parameter is a variable:instantiation_errorProfile parameter neither a variable nor an object identifier:type_error(object_identifier,Profile)Profile parameter is an object identifier but not an object conforming to text_normalization_profile_protocol:domain_error(text_normalization_profile,Profile)Text is not ground:instantiation_errorRepresentation parameter is atom but Text is not an atom:type_error(atom,Text)Representation parameter is chars but Text is not a list of characters:type_error(chars,Text)Representation parameter is codes but Text is not a list of character codes:type_error(codes,Text)domain_error(unicode_scalar_value,Code)title_case/2
Converts text to title case using the library simple word-boundary definition.
statictitle_case(Text,Titlecase)title_case(+text,-text) - one_or_errorRepresentation parameter is a variable:instantiation_errorRepresentation parameter is neither a variable nor atom, chars, or codes:domain_error(text_representation,Representation)Profile parameter is a variable:instantiation_errorProfile parameter neither a variable nor an object identifier:type_error(object_identifier,Profile)Profile parameter is an object identifier but not an object conforming to text_normalization_profile_protocol:domain_error(text_normalization_profile,Profile)Text is not ground:instantiation_errorRepresentation parameter is atom but Text is not an atom:type_error(atom,Text)Representation parameter is chars but Text is not a list of characters:type_error(chars,Text)Representation parameter is codes but Text is not a list of character codes:type_error(codes,Text)domain_error(unicode_scalar_value,Code)decode_entities/2
Decodes semicolon-terminated XML, numeric, and profile-defined named character references using default options.
staticdecode_entities(Text,Decoded)decode_entities(+text,-text) - one_or_errorRepresentation parameter is a variable:instantiation_errorRepresentation parameter is neither a variable nor atom, chars, or codes:domain_error(text_representation,Representation)Profile parameter is a variable:instantiation_errorProfile parameter neither a variable nor an object identifier:type_error(object_identifier,Profile)Profile parameter is an object identifier but not an object conforming to text_normalization_profile_protocol:domain_error(text_normalization_profile,Profile)Text is not ground:instantiation_errorRepresentation parameter is atom but Text is not an atom:type_error(atom,Text)Representation parameter is chars but Text is not a list of characters:type_error(chars,Text)Representation parameter is codes but Text is not a list of character codes:type_error(codes,Text)domain_error(unicode_scalar_value,Code)domain_error(unicode_scalar_value,Value)decode_entities/3
Decodes semicolon-terminated character references. The recognized option is unknown(preserve|error).
staticdecode_entities(Text,Decoded,Options)decode_entities(+text,-text,+list(compound)) - one_or_errorRepresentation parameter is a variable:instantiation_errorRepresentation parameter is neither a variable nor atom, chars, or codes:domain_error(text_representation,Representation)Profile parameter is a variable:instantiation_errorProfile parameter neither a variable nor an object identifier:type_error(object_identifier,Profile)Profile parameter is an object identifier but not an object conforming to text_normalization_profile_protocol:domain_error(text_normalization_profile,Profile)Text is not ground:instantiation_errorRepresentation parameter is atom but Text is not an atom:type_error(atom,Text)Representation parameter is chars but Text is not a list of characters:type_error(chars,Text)Representation parameter is codes but Text is not a list of character codes:type_error(codes,Text)Options is a variable:instantiation_errorOptions is neither a variable nor a list:type_error(list,Options)Option of the list Options is a variable:instantiation_errorOption of the list Options is neither a variable nor a compound term:type_error(compound,Option)Option of the list Options is a compound term but not a valid option:domain_error(option,Option)domain_error(unicode_scalar_value,Code)domain_error(unicode_scalar_value,Value)unknown(error) option is used:domain_error(character_reference,Reference)normalize_whitespace/2
Normalizes whitespace using default options.
staticnormalize_whitespace(Text,Normalized)normalize_whitespace(+text,-text) - one_or_errorRepresentation parameter is a variable:instantiation_errorRepresentation parameter is neither a variable nor atom, chars, or codes:domain_error(text_representation,Representation)Profile parameter is a variable:instantiation_errorProfile parameter neither a variable nor an object identifier:type_error(object_identifier,Profile)Profile parameter is an object identifier but not an object conforming to text_normalization_profile_protocol:domain_error(text_normalization_profile,Profile)Text is not ground:instantiation_errorRepresentation parameter is atom but Text is not an atom:type_error(atom,Text)Representation parameter is chars but Text is not a list of characters:type_error(chars,Text)Representation parameter is codes but Text is not a list of character codes:type_error(codes,Text)domain_error(unicode_scalar_value,Code)normalize_whitespace/3
Normalizes whitespace. Recognized options are trim(Boolean), collapse(none|horizontal|all), line_endings(lf|crlf|cr|preserve), and controls(preserve|remove).
staticnormalize_whitespace(Text,Normalized,Options)normalize_whitespace(+text,-text,+list(compound)) - one_or_errorRepresentation parameter is a variable:instantiation_errorRepresentation parameter is neither a variable nor atom, chars, or codes:domain_error(text_representation,Representation)Profile parameter is a variable:instantiation_errorProfile parameter neither a variable nor an object identifier:type_error(object_identifier,Profile)Profile parameter is an object identifier but not an object conforming to text_normalization_profile_protocol:domain_error(text_normalization_profile,Profile)Text is not ground:instantiation_errorRepresentation parameter is atom but Text is not an atom:type_error(atom,Text)Representation parameter is chars but Text is not a list of characters:type_error(chars,Text)Representation parameter is codes but Text is not a list of character codes:type_error(codes,Text)Options is a variable:instantiation_errorOptions is neither a variable nor a list:type_error(list,Options)Option of the list Options is a variable:instantiation_errorOption of the list Options is neither a variable nor a compound term:type_error(compound,Option)Option of the list Options is a compound term but not a valid option:domain_error(option,Option)domain_error(unicode_scalar_value,Code)clean/2
Cleans text using the default normalization pipeline options.
staticclean(Text,Cleaned)clean(+text,-text) - one_or_errorRepresentation parameter is a variable:instantiation_errorRepresentation parameter is neither a variable nor atom, chars, or codes:domain_error(text_representation,Representation)Profile parameter is a variable:instantiation_errorProfile parameter neither a variable nor an object identifier:type_error(object_identifier,Profile)Profile parameter is an object identifier but not an object conforming to text_normalization_profile_protocol:domain_error(text_normalization_profile,Profile)Text is not ground:instantiation_errorRepresentation parameter is atom but Text is not an atom:type_error(atom,Text)Representation parameter is chars but Text is not a list of characters:type_error(chars,Text)Representation parameter is codes but Text is not a list of character codes:type_error(codes,Text)domain_error(unicode_scalar_value,Code)domain_error(unicode_scalar_value,Value)clean/3
Cleans text by applying entity decoding, case conversion, diacritic handling, Unicode normalization, and whitespace normalization in that order.
staticclean(Text,Cleaned,Options)clean(+text,-text,+list(compound)) - one_or_errorRepresentation parameter is a variable:instantiation_errorRepresentation parameter is neither a variable nor atom, chars, or codes:domain_error(text_representation,Representation)Profile parameter is a variable:instantiation_errorProfile parameter neither a variable nor an object identifier:type_error(object_identifier,Profile)Profile parameter is an object identifier but not an object conforming to text_normalization_profile_protocol:domain_error(text_normalization_profile,Profile)Text is not ground:instantiation_errorRepresentation parameter is atom but Text is not an atom:type_error(atom,Text)Representation parameter is chars but Text is not a list of characters:type_error(chars,Text)Representation parameter is codes but Text is not a list of character codes:type_error(codes,Text)Options is a variable:instantiation_errorOptions is neither a variable nor a list:type_error(list,Options)Option of the list Options is a variable:instantiation_errorOption of the list Options is neither a variable nor a compound term:type_error(compound,Option)Option of the list Options is a compound term but not a valid option:domain_error(option,Option)domain_error(unicode_scalar_value,Code)domain_error(unicode_scalar_value,Value)unknown_entities(error) option is used:domain_error(character_reference,Reference)Protected predicates
(none)
Private predicates
(none)
Operators
(none)