Rune Caster 1.0.0
Modern C++ Text Processing Framework
Loading...
Searching...
No Matches
rune_caster::spell Namespace Reference

Namespaces

namespace  composition
namespace  core
namespace  factory
namespace  filter
namespace  language

Classes

class  CategoryFilter
 Remove specific character categories using C++20 concepts. More...
class  CustomSpell
 Create a custom spell from a lambda function. More...
class  PunctuationFilter
 Remove punctuation characters using C++20 concepts. More...
class  ScriptFilter
 Remove or keep only specific scripts using C++20 concepts. More...
class  SearchPreprocess
 Search preprocessing: cleanup + remove punctuation + unicode NFC. More...
class  SpellComposition
 Composition of two spells into a single spell pipeline. More...
class  TextCleanup
 Standard text cleanup: normalize whitespace + trim + lowercase. More...

Functions

auto lowercase ()
 Convert text to lowercase.
auto uppercase ()
 Convert text to uppercase.
auto titlecase ()
 Convert text to title case.
auto trim ()
 Trim leading and trailing whitespace.
auto normalize_whitespace (bool collapse_multiple=true, bool trim_edges=true)
 Normalize whitespace (collapse multiple spaces, optionally trim)
auto unicode_nfc ()
 Apply Unicode NFC normalization.
auto unicode_nfd ()
 Apply Unicode NFD normalization.
auto unicode_nfkc ()
 Apply Unicode NFKC normalization.
auto unicode_nfkd ()
 Apply Unicode NFKD normalization.
auto tokenize ()
 Tokenize text by whitespace.
auto remove_punctuation ()
 Remove punctuation characters.
auto detect_language ()
 Detect language of text.
auto cleanup ()
 Create a standard text cleanup spell.
auto search_preprocess ()
 Create a search preprocessing spell.
template<typename Func>
auto custom (std::string name, std::string description, Func &&func)
 Create a custom spell from a function.
template<typename FirstSpell, typename SecondSpell>
auto compose (FirstSpell &&first, SecondSpell &&second)
 Compose two spells into a single spell pipeline.
template<typename Spell>
RuneSequence cast_spell (const RuneSequence &input, const Spell &spell)
 Helper function for casting spells on RuneSequence.

Function Documentation

◆ cast_spell()

template<typename Spell>
RuneSequence rune_caster::spell::composition::cast_spell ( const RuneSequence & input,
const Spell & spell )

Helper function for casting spells on RuneSequence.

This is a convenience function that applies a spell to a RuneSequence and returns the transformed result.

Template Parameters
SpellThe type of spell to apply
Parameters
inputThe input sequence to transform
spellThe spell to apply
Returns
The transformed sequence

Definition at line 117 of file spell_composition.hpp.

◆ cleanup()

auto rune_caster::spell::cleanup ( )
inline

Create a standard text cleanup spell.

Definition at line 150 of file spell.hpp.

◆ compose()

template<typename FirstSpell, typename SecondSpell>
auto rune_caster::spell::composition::compose ( FirstSpell && first,
SecondSpell && second )

Compose two spells into a single spell pipeline.

This function creates a SpellComposition that applies the first spell, then applies the second spell to the result. Uses C++20 concepts for compile-time validation.

Template Parameters
FirstSpellThe type of the first spell
SecondSpellThe type of the second spell
Parameters
firstThe first spell to apply
secondThe second spell to apply
Returns
A composed spell that applies both spells in sequence

Definition at line 94 of file spell_composition.hpp.

◆ custom()

template<typename Func>
auto rune_caster::spell::custom ( std::string name,
std::string description,
Func && func )

Create a custom spell from a function.

Definition at line 211 of file spell.hpp.

◆ detect_language()

auto rune_caster::spell::detect_language ( )
inline

Detect language of text.

Definition at line 124 of file spell.hpp.

◆ lowercase()

auto rune_caster::spell::lowercase ( )
inline

Convert text to lowercase.

Definition at line 47 of file spell.hpp.

◆ normalize_whitespace()

auto rune_caster::spell::normalize_whitespace ( bool collapse_multiple = true,
bool trim_edges = true )
inline

Normalize whitespace (collapse multiple spaces, optionally trim)

Definition at line 75 of file spell.hpp.

◆ remove_punctuation()

auto rune_caster::spell::remove_punctuation ( )
inline

Remove punctuation characters.

Definition at line 117 of file spell.hpp.

◆ search_preprocess()

auto rune_caster::spell::search_preprocess ( )
inline

Create a search preprocessing spell.

Definition at line 176 of file spell.hpp.

◆ titlecase()

auto rune_caster::spell::titlecase ( )
inline

Convert text to title case.

Definition at line 61 of file spell.hpp.

◆ tokenize()

auto rune_caster::spell::tokenize ( )
inline

Tokenize text by whitespace.

Definition at line 110 of file spell.hpp.

◆ trim()

auto rune_caster::spell::trim ( )
inline

Trim leading and trailing whitespace.

Definition at line 68 of file spell.hpp.

◆ unicode_nfc()

auto rune_caster::spell::unicode_nfc ( )
inline

Apply Unicode NFC normalization.

Definition at line 82 of file spell.hpp.

◆ unicode_nfd()

auto rune_caster::spell::unicode_nfd ( )
inline

Apply Unicode NFD normalization.

Definition at line 89 of file spell.hpp.

◆ unicode_nfkc()

auto rune_caster::spell::unicode_nfkc ( )
inline

Apply Unicode NFKC normalization.

Definition at line 96 of file spell.hpp.

◆ unicode_nfkd()

auto rune_caster::spell::unicode_nfkd ( )
inline

Apply Unicode NFKD normalization.

Definition at line 103 of file spell.hpp.

◆ uppercase()

auto rune_caster::spell::uppercase ( )
inline

Convert text to uppercase.

Definition at line 54 of file spell.hpp.