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

Functions

auto whitespace ()
 Factory functions for creating commonly used spells.
auto whitespace (bool collapse_multiple, bool trim_edges=true)
 Create a customized whitespace normalizer.
auto lowercase ()
 Create a lowercase converter.
auto uppercase ()
 Create an uppercase converter.
auto titlecase ()
 Create a titlecase converter.
auto unicode_nfc ()
 Create an NFC (Canonical Decomposition followed by Canonical Composition) normalizer.
auto unicode_nfd ()
 Create an NFD (Canonical Decomposition) normalizer.
auto unicode_nfkc ()
 Create an NFKC (Compatibility Decomposition followed by Canonical Composition) normalizer.
auto unicode_nfkd ()
 Create an NFKD (Compatibility Decomposition) normalizer.
auto punctuation (bool remove=true)
 Create a punctuation filter.
template<typename CaseType = void>
auto text_normalizer (CaseType case_type={})
 Create a text normalizer that applies common normalizations.
auto search_preprocessor ()
 Create a search-optimized text preprocessor.
auto display_formatter ()
 Create a display-optimized text formatter.
template<bool RemovePunctuation = true>
auto text_normalizer_with_punctuation ()
 Text normalizer with optional punctuation removal.
auto trim ()
auto tokenizer_whitespace ()

Function Documentation

◆ display_formatter()

auto rune_caster::spell::factory::display_formatter ( )
inline

Create a display-optimized text formatter.

This creates a spell composition optimized for display:

  • Normalizes whitespace
  • Applies Unicode NFC normalization
  • Converts to titlecase
Returns
A composed spell for display formatting

Definition at line 166 of file spell_factory.hpp.

◆ lowercase()

auto rune_caster::spell::factory::lowercase ( )
inline

Create a lowercase converter.

Returns
A CaseConverter that converts text to lowercase

Definition at line 52 of file spell_factory.hpp.

◆ punctuation()

auto rune_caster::spell::factory::punctuation ( bool remove = true)
inline

Create a punctuation filter.

Parameters
removeIf true (default) remove punctuation; if false keep only punctuation.

Definition at line 112 of file spell_factory.hpp.

◆ search_preprocessor()

auto rune_caster::spell::factory::search_preprocessor ( )
inline

Create a search-optimized text preprocessor.

This creates a spell composition optimized for search indexing:

  • Normalizes whitespace
  • Applies Unicode NFC normalization
  • Converts to lowercase
Returns
A composed spell for search preprocessing

Definition at line 149 of file spell_factory.hpp.

◆ text_normalizer()

template<typename CaseType = void>
auto rune_caster::spell::factory::text_normalizer ( CaseType case_type = {})

Create a text normalizer that applies common normalizations.

This creates a composed spell that applies whitespace normalization, Unicode NFC normalization, and optionally case conversion.

Parameters
case_typeOptional case conversion to apply (default: no case conversion)
Returns
A composed spell for comprehensive text normalization

Definition at line 128 of file spell_factory.hpp.

◆ text_normalizer_with_punctuation()

template<bool RemovePunctuation = true>
auto rune_caster::spell::factory::text_normalizer_with_punctuation ( )
inline

Text normalizer with optional punctuation removal.

whitespace -> unicode NFC -> (optional punctuation removal)

Definition at line 179 of file spell_factory.hpp.

◆ titlecase()

auto rune_caster::spell::factory::titlecase ( )
inline

Create a titlecase converter.

Returns
A CaseConverter that converts text to titlecase

Definition at line 68 of file spell_factory.hpp.

◆ tokenizer_whitespace()

auto rune_caster::spell::factory::tokenizer_whitespace ( )
inline

Definition at line 191 of file spell_factory.hpp.

◆ trim()

auto rune_caster::spell::factory::trim ( )
inline

Definition at line 188 of file spell_factory.hpp.

◆ unicode_nfc()

auto rune_caster::spell::factory::unicode_nfc ( )
inline

Create an NFC (Canonical Decomposition followed by Canonical Composition) normalizer.

Returns
A UnicodeNormalizer using NFC normalization

Definition at line 78 of file spell_factory.hpp.

◆ unicode_nfd()

auto rune_caster::spell::factory::unicode_nfd ( )
inline

Create an NFD (Canonical Decomposition) normalizer.

Returns
A UnicodeNormalizer using NFD normalization

Definition at line 86 of file spell_factory.hpp.

◆ unicode_nfkc()

auto rune_caster::spell::factory::unicode_nfkc ( )
inline

Create an NFKC (Compatibility Decomposition followed by Canonical Composition) normalizer.

Returns
A UnicodeNormalizer using NFKC normalization

Definition at line 94 of file spell_factory.hpp.

◆ unicode_nfkd()

auto rune_caster::spell::factory::unicode_nfkd ( )
inline

Create an NFKD (Compatibility Decomposition) normalizer.

Returns
A UnicodeNormalizer using NFKD normalization

Definition at line 102 of file spell_factory.hpp.

◆ uppercase()

auto rune_caster::spell::factory::uppercase ( )
inline

Create an uppercase converter.

Returns
A CaseConverter that converts text to uppercase

Definition at line 60 of file spell_factory.hpp.

◆ whitespace() [1/2]

auto rune_caster::spell::factory::whitespace ( )
inline

Factory functions for creating commonly used spells.

These factory functions provide convenient ways to create spell instances with commonly used configurations. They use modern C++20 features for optimal performance and type safety.

Create a standard whitespace normalizer

Creates a WhitespaceNormalizer that collapses multiple whitespace characters into single spaces and trims leading/trailing whitespace.

Returns
A WhitespaceNormalizer with default settings

Definition at line 31 of file spell_factory.hpp.

◆ whitespace() [2/2]

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

Create a customized whitespace normalizer.

Parameters
collapse_multipleIf true, collapse multiple whitespace into single space
trim_edgesIf true, remove leading and trailing whitespace
Returns
A WhitespaceNormalizer with custom settings

Definition at line 42 of file spell_factory.hpp.