Rune Caster 1.0.0
Modern C++ Text Processing Framework
|
Pre-defined spells using the unified Spell interface. More...
Functions | |
Spell | whitespace (bool collapse_multiple=true, bool trim_edges=true) |
Create a custom whitespace normalizer. | |
Spell | replace_char (char32_t from, char32_t to) |
Create a character replacement spell. | |
Spell | replace_string (std::string_view from, std::string_view to) |
Create a string replacement spell. | |
template<typename Predicate> | |
Spell | remove_if (Predicate &&predicate) |
Create a spell that removes characters matching a predicate. | |
template<typename Predicate> | |
Spell | keep_if (Predicate &&predicate) |
Create a spell that keeps only characters matching a predicate. | |
template<typename Transform> | |
Spell | transform_chars (Transform &&transform) |
Create a spell that transforms each character. | |
Spell | detect_language () |
Create a language detection spell. | |
Spell | filter_by_script (unicode::Script script, bool keep=true) |
Create a script filtering spell. | |
Spell | filter_by_category (unicode::Category category, bool keep=true) |
Create a category filtering spell. |
Variables | |
const Spell | whitespace_normalizer |
Normalize whitespace characters. | |
const Spell | trim_whitespace |
Trim leading and trailing whitespace. | |
const Spell | collapse_whitespace |
Collapse multiple whitespace into single spaces. | |
const Spell | to_lowercase |
Convert text to lowercase. | |
const Spell | to_uppercase |
Convert text to uppercase. | |
const Spell | to_titlecase |
Convert text to title case. | |
const Spell | unicode_nfc |
Apply Unicode NFC normalization. | |
const Spell | unicode_nfd |
Apply Unicode NFD normalization. | |
const Spell | unicode_nfkc |
Apply Unicode NFKC normalization. | |
const Spell | unicode_nfkd |
Apply Unicode NFKD normalization. | |
const Spell | remove_punctuation |
Remove punctuation characters. | |
const Spell | alphanumeric_only |
Keep only letters and digits. | |
const Spell | remove_digits |
Remove digits. | |
const Spell | ascii_only |
Keep only ASCII characters. | |
const Spell | text_cleanup |
Standard text cleanup (whitespace + NFC + lowercase) | |
const Spell | search_preprocess |
Search-optimized preprocessing. | |
const Spell | display_format |
Display-optimized formatting. |
Pre-defined spells using the unified Spell interface.
This namespace contains commonly used spells implemented using the new unified Spell architecture. All spells are compatible with the Caster pipeline and can be composed using operator|.
Spell rune_caster::spells::detect_language | ( | ) |
Create a language detection spell.
Spell rune_caster::spells::filter_by_category | ( | unicode::Category | category, |
bool | keep = true ) |
Create a category filtering spell.
category | The Unicode category to filter by |
keep | If true, keep only this category; if false, remove this category |
Spell rune_caster::spells::filter_by_script | ( | unicode::Script | script, |
bool | keep = true ) |
Create a script filtering spell.
script | The Unicode script to filter by |
keep | If true, keep only this script; if false, remove this script |
Spell rune_caster::spells::keep_if | ( | Predicate && | predicate | ) |
Create a spell that keeps only characters matching a predicate.
predicate | Function that returns true for characters to keep |
Definition at line 164 of file spells.hpp.
Spell rune_caster::spells::remove_if | ( | Predicate && | predicate | ) |
Create a spell that removes characters matching a predicate.
predicate | Function that returns true for characters to remove |
Definition at line 148 of file spells.hpp.
Spell rune_caster::spells::replace_char | ( | char32_t | from, |
char32_t | to ) |
Create a character replacement spell.
from | Character to replace |
to | Replacement character |
Spell rune_caster::spells::replace_string | ( | std::string_view | from, |
std::string_view | to ) |
Create a string replacement spell.
from | String to replace |
to | Replacement string |
Spell rune_caster::spells::transform_chars | ( | Transform && | transform | ) |
Create a spell that transforms each character.
transform | Function that transforms individual runes |
Definition at line 178 of file spells.hpp.
Spell rune_caster::spells::whitespace | ( | bool | collapse_multiple = true, |
bool | trim_edges = true ) |
Create a custom whitespace normalizer.
collapse_multiple | If true, collapse multiple whitespace |
trim_edges | If true, trim leading/trailing whitespace |
|
extern |
Keep only letters and digits.
|
extern |
Keep only ASCII characters.
|
extern |
Collapse multiple whitespace into single spaces.
|
extern |
Display-optimized formatting.
|
extern |
Remove digits.
|
extern |
Remove punctuation characters.
|
extern |
Search-optimized preprocessing.
|
extern |
Standard text cleanup (whitespace + NFC + lowercase)
|
extern |
Convert text to title case.
|
extern |
Convert text to uppercase.
|
extern |
Trim leading and trailing whitespace.
|
extern |
Apply Unicode NFC normalization.
|
extern |
Apply Unicode NFD normalization.
|
extern |
Apply Unicode NFKC normalization.
|
extern |
Apply Unicode NFKD normalization.