AmberDB
view release on metacpan or search on metacpan
lib/AmberDB/Locale/Lang/gb.pm view on Meta::CPAN
package AmberDB::Locale::Lang::gb;
use 5.016;
use warnings;
use utf8;
our $VERSION = '5.25.1';
my $CREATED = '2026-09-03';
# -------------------------------------------------------
# Global Base (gb) Locale Data for AmberDB::Locale.
#
# Pure data module â no logic, no methods other than data().
#
# Design Principles for Global Base (gb):
# 1. Universal Multilingual Support: Designed for international,
# cross-border datasets combining English, Turkish, German,
# French, Spanish, Italian, Scandinavian, and Slavic-Latin text.
# 2. Comprehensive Alphabet: alphabet_chars includes all European,
# Nordic, and Turkish extended Latin letters so no valid characters
# are stripped during text sanitization.
# 3. Permissive Search Regex: regex_map expands characters across their
# accented and unaccented forms (e.g. searching 'cafe' matches 'café',
# 'munchen' matches 'münchen', 'seker' matches 'Åeker').
# 4. Canonical Accent Folding: accent_map flattens accented letters
# to base Latin forms for high-recall inverted search indexing (.src).
# 5. Lossless ASCII Transliteration: ascii_map cleanly converts
# non-decomposable Unicode ligatures (Ã->ss, æ->ae, Å->oe, ø->o,
# ı->i, Å->l, ð->d, þ->th, É->e) for URL slugs and ASCII IDs.
# 6. International Formatting: Default numbers, dates, and currency
# follow ISO and international English conventions (USD/cent, . decimal).
# -------------------------------------------------------
sub data {
return {
# ---------------------------------------------------------
# Casing special-cases
# uc_map: applied BEFORE Perl's uc()
# lc_map: applied BEFORE Perl's lc()
# Standard Unicode casing handles almost all Latin chars.
# Turkish dotted capital İ -> i is preserved during lc.
# ---------------------------------------------------------
uc_map => {},
lc_map => {
"\x{130}" => 'i', # Turkish dotted capital İ -> i
},
# ---------------------------------------------------------
# Case-insensitive & accent-tolerant search regex character map
# Maps both base and accented characters to a regex character class
# covering all regional variations.
# ---------------------------------------------------------
regex_map => {
# A variations: a, á, à , â, ä, ã, Ã¥, Ä, æ
'a' => '[aA\x{E1}\x{C1}\x{E0}\x{C0}\x{E2}\x{C2}\x{E4}\x{C4}\x{E3}\x{C3}\x{E5}\x{C5}\x{101}\x{100}\x{E6}\x{C6}]',
'A' => '[aA\x{E1}\x{C1}\x{E0}\x{C0}\x{E2}\x{C2}\x{E4}\x{C4}\x{E3}\x{C3}\x{E5}\x{C5}\x{101}\x{100}\x{E6}\x{C6}]',
# C variations: c, ç, Ä, Ä
'c' => '[cC\x{E7}\x{C7}\x{107}\x{106}\x{10D}\x{10C}]',
'C' => '[cC\x{E7}\x{C7}\x{107}\x{106}\x{10D}\x{10C}]',
"\x{E7}" => '[cC\x{E7}\x{C7}\x{107}\x{106}\x{10D}\x{10C}]', # ç
"\x{C7}" => '[cC\x{E7}\x{C7}\x{107}\x{106}\x{10D}\x{10C}]', # Ã
# D variations: d, ð, Ä
lib/AmberDB/Locale/Lang/gb.pm view on Meta::CPAN
"\x{153}" => 'oe', "\x{152}" => 'OE',# Å â oe, Å â OE
"\x{131}" => 'i', # ı â i
"\x{F0}" => 'd', "\x{D0}" => 'D', # ð â d, à â D
"\x{FE}" => 'th', "\x{DE}" => 'TH',# þ â th, à â TH
"\x{F8}" => 'o', "\x{D8}" => 'O', # ø â o, à â O
"\x{142}" => 'l', "\x{141}" => 'L', # Å â l, Å â L
"\x{111}" => 'd', "\x{110}" => 'D', # Ä â d, Ä â D
"\x{259}" => 'e', "\x{18F}" => 'E', # É â e, Æ â E
},
# ---------------------------------------------------------
# num2text number words (International English standard)
# ---------------------------------------------------------
numbers => {
zero => 'Zero',
negative => 'Minus',
ones => [qw(One Two Three Four Five Six Seven Eight Nine)],
tens => [qw(Ten Twenty Thirty Forty Fifty Sixty Seventy Eighty Ninety)],
hundred => 'Hundred',
thousand => 'Thousand',
million => 'Million',
billion => 'Billion',
currency => { main => 'USD', sub => 'cent' },
decimal_sep => '.',
hundred_one_prefix => 1, # One Hundred
thousand_one_prefix => 1, # One Thousand
},
# ---------------------------------------------------------
# HTML entity extras
# ---------------------------------------------------------
html_entities => {},
# ---------------------------------------------------------
# Month and Day names (International English)
# ---------------------------------------------------------
months => [
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
],
days => [
"Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday"
],
# ---------------------------------------------------------
# Formatting metadata (number, currency, date)
# ---------------------------------------------------------
number_format => {
decimal_sep => '.',
group_sep => ',',
group_size => 3,
},
};
}
1;
__END__
=encoding utf8
=head1 NAME
AmberDB::Locale::Lang::gb - Global Base Language Definition and Default Locale Data for AmberDB
=head1 SYNOPSIS
use AmberDB::Locale;
my $loc = AmberDB::Locale->new('gb');
=head1 DESCRIPTION
Provides Global Base (gb) universal casing, multilingual extended Latin character maps, search regex patterns, canonical accent folding, ASCII transliteration, and international formatting for the AmberDB locale engine. Global Base (gb) serves as the...
=head1 AUTHOR
Maruf Cetin <marufcetin@gmail.com>
=head1 LICENSE AND COPYRIGHT
Copyright (C) 2026 Maruf Cetin.
This library is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.
=cut
( run in 1.896 second using v1.01-cache-2.11-cpan-364913b4093 )