Jump to content

Transliterate English text using the Greek alphabet: Difference between revisions

m
→‎{{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?))
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>, 's ' =:ch<χ> 'ς ';,
:th<θ>, :ps<ψ>, :Ch<Χ>, :Th<Θ>, :Ps<Ψ>, :kh<χ>, 's ' => 'ς ';
my %post =
:ch<χ>,my %post = :tha<θα>, :psb<ψβ>, :Chd<Χδ>, :The<Θε>, :Psf<Ψφ>, :khg<χγ>, :ah<αη>, :bi<βι>, :dj<δι>,
:e<ε>, :f<φ>, :gk<γκ>, :hl<ηλ>, :im<ιμ>, :jn<ιν>, :ko<κο>, :lp<λπ>, :mq<μκ>, :nr<νρ>, :os<οσ>,
:p<π>, :q<κ>, :r<ρ>, :s<σ>, :t<τ>, :u<υ>, :v<β>, :w<ω>, :x<ξ>, :y<υ>, :z<ζ>, :A<Α>, :B<Β>,
:A<Α>, :B<Β>, :D<Δ>, :E<Ε>, :F<Φ>, :G<Γ>, :H<Η>, :I<Ι>, :L<Λ>, :M<Μ>, :N<Ν>,
:O<Ο>, :P<Π>, :Q<Κ>, :R<Ρ>, :S<Σ>, :T<Τ>, :U<Υ>, :W<Ω>, :X<Ξ>, :Z<Ζ>;
:Z<Ζ>;
 
$string.=subst(:g, .key, .value ) for flat %pre, %post;
Line 303 ⟶ 304:
given 'sphinx of black quartz, judge my vow.';</lang>
{{out}}
{{incorrect|Raku|out-of-date?}}
"The" => "Θε", not "Τηε"
<pre>English:
 
Line 320 ⟶ 319:
"Greek":
 
ΤηεΘε κυικ βροων φοξ ιυμπεδ οβερ τηεθε λαζυ δογ.
 
Ι ωας λωκινγ ατ σομε ροδοδενδρονς ιν μυ βακ γαρδεν,
δρεσσεδ ιν μυ κηακιχακι σηορτσ, ωηεν τηεθε τελεφονε ρανγ.
 
Ας Ι ανσωερεδ ιτ, Ι χηρφυλλυ γλιμπσεδγλιμψεδ τηατθατ τηεθε Ιυλυ συν
cαυσεδ α φραγμεντ οφ βλακ πινε ωαξ το ωζε ον τηεθε βελβετ κυιλτ
λαυινγ ιν μυ πατιο.
 
10,333

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.