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

Language detection and identification functionality. More...

Classes

struct  DetectionResult
 Language detection result with confidence metrics. More...

Enumerations

enum class  Code : uint16_t {
  Unknown = 0 , Korean , English , Japanese ,
  Chinese , Arabic , Russian , Spanish ,
  French , German , Italian , Portuguese ,
  Dutch , Swedish , Norwegian , Danish ,
  Finnish , Polish , Czech , Hungarian ,
  Turkish , Hebrew , Thai , Vietnamese ,
  Indonesian , Malay , Hindi , Bengali ,
  Tamil , Telugu , Gujarati , Marathi ,
  Punjabi , Urdu , Persian , Pashto ,
  Kurdish , Max
}
 Enumeration of supported language codes. More...

Functions

constexpr std::string_view to_string (Code code) noexcept
 Convert language code to ISO 639-1 string representation.
constexpr std::string_view get_name (Code code) noexcept
 Get the human-readable name of a language.

Detailed Description

Language detection and identification functionality.

This namespace contains language codes, detection algorithms, and utilities for working with multilingual text.

Enumeration Type Documentation

◆ Code

enum class rune_caster::language::Code : uint16_t
strong

Enumeration of supported language codes.

Represents the languages supported by the Rune Caster framework. Each language is mapped to a unique identifier that can be used for language-specific processing and detection.

The enumeration follows ISO 639-1 language codes where applicable.

auto korean_text = RuneString::from_utf8("안녕하세요");
if (korean_text.primary_language() == Code::Korean) {
std::cout << "Korean text detected!" << std::endl;
}
static RuneString from_utf8(std::string_view utf8_text)
Create a RuneString from UTF-8 text.
Code
Enumeration of supported language codes.
Definition language.hpp:43
@ Korean
한국어 (ko-KR) - Korean
Definition language.hpp:45
Enumerator
Unknown 

Unknown or undetected language.

Korean 

한국어 (ko-KR) - Korean

English 

English (en-US) - English.

Japanese 

日本語 (ja-JP) - Japanese

Chinese 

中文 (zh-CN) - Chinese (Simplified)

Arabic 

العربية (ar) - Arabic

Russian 

Русский (ru) - Russian.

Spanish 

Español (es) - Spanish.

French 

Français (fr) - French.

German 

Deutsch (de) - German.

Italian 

Italiano (it) - Italian.

Portuguese 

Português (pt) - Portuguese.

Dutch 

Nederlands (nl) - Dutch.

Swedish 

Svenska (sv) - Swedish.

Norwegian 

Norsk (no) - Norwegian.

Danish 

Dansk (da) - Danish.

Finnish 

Suomi (fi) - Finnish.

Polish 

Polski (pl) - Polish.

Czech 

Čeština (cs) - Czech.

Hungarian 

Magyar (hu) - Hungarian.

Turkish 

Türkçe (tr) - Turkish.

Hebrew 

עברית (he) - Hebrew

Thai 

ไทย (th) - Thai

Vietnamese 

Tiếng Việt (vi) - Vietnamese.

Indonesian 

Bahasa Indonesia (id) - Indonesian.

Malay 

Bahasa Melayu (ms) - Malay.

Hindi 

हिन्दी (hi) - Hindi

Bengali 

বাংলা (bn) - Bengali

Tamil 

தமிழ் (ta) - Tamil

Telugu 

తెలుగు (te) - Telugu

Gujarati 

ગુજરાતી (gu) - Gujarati

Marathi 

मराठी (mr) - Marathi

Punjabi 

ਪੰਜਾਬੀ (pa) - Punjabi

Urdu 

اردو (ur) - Urdu

Persian 

فارسی (fa) - Persian/Farsi

Pashto 

پښتو (ps) - Pashto

Kurdish 

کوردی (ku) - Kurdish

Max 

Sentinel value for enumeration bounds.

Definition at line 43 of file language.hpp.

Function Documentation

◆ get_name()

std::string_view rune_caster::language::get_name ( Code code)
constexprnoexcept

Get the human-readable name of a language.

Parameters
codeLanguage code to get the name for
Returns
English name of the language (e.g., "Korean", "English")
Note
This function is constexpr and can be evaluated at compile time
auto name = get_name(Code::Japanese); // Returns "Japanese"
std::cout << "Language name: " << name << std::endl;
@ Japanese
日本語 (ja-JP) - Japanese
Definition language.hpp:47
constexpr std::string_view get_name(Code code) noexcept
Get the human-readable name of a language.
Definition language.hpp:181

Definition at line 181 of file language.hpp.

◆ to_string()

std::string_view rune_caster::language::to_string ( Code code)
constexprnoexcept

Convert language code to ISO 639-1 string representation.

Parameters
codeLanguage code to convert
Returns
ISO language code string (e.g., "ko-KR", "en-US")
Note
This function is constexpr and can be evaluated at compile time
auto lang_str = to_string(Code::Korean); // Returns "ko-KR"
std::cout << "Language: " << lang_str << std::endl;
constexpr std::string_view to_string(Code code) noexcept
Convert language code to ISO 639-1 string representation.
Definition language.hpp:127

Definition at line 127 of file language.hpp.