Rune Caster 1.0.0
Modern C++ Text Processing Framework
Loading...
Searching...
No Matches
spell_language.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "spell_base.hpp"
4#include "language.hpp"
5#include "rune_sequence.hpp"
6
7namespace rune_caster {
8
9// Forward declarations
10class Rune;
11
12namespace spell {
13namespace language {
14
23public:
26
32 RuneSequence operator()(const RuneSequence& input) const override;
33
34 std::string description() const override;
35 std::string name() const override { return "LanguageDetector"; }
36
37private:
43 rune_caster::language::Code detect_language_from_script(const RuneSequence& text) const;
44};
45
56private:
57 rune_caster::language::Code target_language_;
58
59public:
62
68
69 RuneSequence operator()(const RuneSequence& input) const override;
70 std::string description() const override;
71 std::string name() const override { return "GraphemeToPhoneme"; }
72
77 rune_caster::language::Code target_language() const noexcept { return target_language_; }
78
79private:
85 std::string convert_to_phoneme(const Rune& rune) const;
86};
87
88} // namespace language
89} // namespace spell
90} // namespace rune_caster
Represents a single textual unit with Unicode and linguistic properties.
Definition rune.hpp:23
RuneSequence operator()(const RuneSequence &input) const override
Apply the spell transformation.
rune_caster::language::Code target_language() const noexcept
Get the target language of this converter.
GraphemeToPhoneme(rune_caster::language::Code language)
Construct a G2P converter for a specific language.
std::string name() const override
Get the spell's name.
std::string description() const override
Get the spell's description.
Language detection spell using C++20 concepts.
std::string name() const override
Get the spell's name.
std::string description() const override
Get the spell's description.
RuneSequence operator()(const RuneSequence &input) const override
Apply language detection to the input sequence.
Language identification and localization support.
Code
Enumeration of supported language codes.
Definition language.hpp:43
RuneString RuneSequence
Backward compatibility alias for RuneString.
spell_base< RuneSequence > sequence_spell
Most common spell type: RuneSequence -> RuneSequence.