Transliterate English text using the Greek alphabet: Difference between revisions
Transliterate English text using the Greek alphabet (view source)
Revision as of 17:50, 20 June 2022
, 1 year ago→{{header|Raku}}: Make transliteration order more deterministic. Ensure multi-char transforms always happen before single char. Thanks for the heads-up!
(→{{header|Raku}}: marked incorrect ("The" => "Θε", not "Τηε" - output ot of date?)) |
Thundergnat (talk | contribs) m (→{{header|Raku}}: Make transliteration order more deterministic. Ensure multi-char transforms always happen before single char. Thanks for the heads-up!) |
||
Line 268:
=={{header|Raku}}==
<lang perl6>sub to-Greek (Str $string is copy) {
my %pre = :Ph<F>, :ck<k>, :ee<h>, :J<I>, :rh<r>,:oo<w>, :ph<f>,
:th<θ>, :ps<ψ>, :Ch<Χ>, :Th<Θ>, :Ps<Ψ>, :kh<χ>, 's ' => 'ς ';
:O<Ο>, :P<Π>, :Q<Κ>, :R<Ρ>, :S<Σ>, :T<Τ>, :U<Υ>, :W<Ω>, :X<Ξ>,
:Z<Ζ>;
$string.=subst(:g, .key, .value ) for flat %pre, %post;
Line 303 ⟶ 304:
given 'sphinx of black quartz, judge my vow.';</lang>
{{out}}
<pre>English:
Line 320 ⟶ 319:
"Greek":
Ι ωας λωκινγ ατ σομε ροδοδενδρονς ιν μυ βακ γαρδεν,
δρεσσεδ ιν μυ
Ας Ι ανσωερεδ ιτ, Ι χηρφυλλυ
cαυσεδ α φραγμεντ οφ βλακ πινε ωαξ το ωζε ον
λαυινγ ιν μυ πατιο.
|