Rune Caster 1.0.0
Modern C++ Text Processing Framework
Loading...
Searching...
No Matches
spell.hpp File Reference

Simple and unified spell system for text transformation. More...

#include "spell_base.hpp"
#include "spell_extensible.hpp"
#include "rune_sequence.hpp"
#include "caster.hpp"
#include "spell_core.hpp"
#include "spell_filter.hpp"
#include "spell_language.hpp"
#include "spell_token.hpp"
Include dependency graph for spell.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  rune_caster::spell::TextCleanup
 Standard text cleanup: normalize whitespace + trim + lowercase. More...
class  rune_caster::spell::SearchPreprocess
 Search preprocessing: cleanup + remove punctuation + unicode NFC. More...
class  rune_caster::spell::CustomSpell< Func >
 Create a custom spell from a lambda function. More...

Namespaces

namespace  rune_caster
namespace  rune_caster::spell

Functions

auto rune_caster::spell::lowercase ()
 Convert text to lowercase.
auto rune_caster::spell::uppercase ()
 Convert text to uppercase.
auto rune_caster::spell::titlecase ()
 Convert text to title case.
auto rune_caster::spell::trim ()
 Trim leading and trailing whitespace.
auto rune_caster::spell::normalize_whitespace (bool collapse_multiple=true, bool trim_edges=true)
 Normalize whitespace (collapse multiple spaces, optionally trim)
auto rune_caster::spell::unicode_nfc ()
 Apply Unicode NFC normalization.
auto rune_caster::spell::unicode_nfd ()
 Apply Unicode NFD normalization.
auto rune_caster::spell::unicode_nfkc ()
 Apply Unicode NFKC normalization.
auto rune_caster::spell::unicode_nfkd ()
 Apply Unicode NFKD normalization.
auto rune_caster::spell::tokenize ()
 Tokenize text by whitespace.
auto rune_caster::spell::remove_punctuation ()
 Remove punctuation characters.
auto rune_caster::spell::detect_language ()
 Detect language of text.
auto rune_caster::spell::cleanup ()
 Create a standard text cleanup spell.
auto rune_caster::spell::search_preprocess ()
 Create a search preprocessing spell.
template<typename Func>
auto rune_caster::spell::custom (std::string name, std::string description, Func &&func)
 Create a custom spell from a function.

Detailed Description

Simple and unified spell system for text transformation.

This is the ONLY header you need to include for spell functionality. All spells are available through simple factory functions in the rune_caster::spell namespace.

Usage:

using namespace rune_caster;
// Simple usage with pipe operator
auto result = text | spell::lowercase() | spell::trim();
// Or with caster
auto result = make_caster(text)
.cast(spell::trim())
.result();
auto trim()
Trim leading and trailing whitespace.
Definition spell.hpp:68
auto lowercase()
Convert text to lowercase.
Definition spell.hpp:47
constexpr auto make_caster(T &&data) noexcept -> caster< std::decay_t< T > >
Factory function to create a caster (C++20 template argument deduction)
Definition caster.hpp:124
Simple and unified spell system for text transformation.

Definition in file spell.hpp.