Class v {a,e,i,o,u}
Class u {p,t,k,f,s,c}
Class w {b,d,g,v,z,g}
Class c {@u,@w,h,j,l,m,n,lq,r,w,x}
a:
@c *=>@c ;/$ @c* @v* _//{$ _,$ @c _}
b:
@c=>* /; _
c:
{@v,@c}=>* /; @v {@v, @c}* _
d:
* @w$1=>$1 @u/_ ;
* @u$1=>$1 @w/_ ;
e:
@c$1 ;=>; $1
f:
(@c @v)$1=>$1 $1/; _
g:
;=>*
Class consonant {p,b,t,d,k,g,f,v,s,z,x,j,l,r,m,n,c,w}
Class vowel {a,e,i,o,u}
Class unvoiced {p,t,k,f,s,c}
Class voiced {b,d,g,v,z,g}
Class consonant {@unvoiced,@voiced,h,j,l,m,n,q,r,w,x}
# find first consonant after first vowel
part-1:
@consonant * => @consonant ; / $ @consonant* @vowel* _ // {$ _, $ @consonant _}
romanizer-a:
unchanged
# delete the consonant after the seperator
part-2:
@consonant => * / ; _
romanizer-b:
unchanged
# remove everything except the second vowel
part-3:
{@vowel, @consonant} => * / ; @vowel {@vowel, @consonant}* _
romanizer-c:
unchanged
# voicings
part-4:
* @voiced$1 => $1 @unvoiced / _ ;
* @unvoiced$1 => $1 @voiced / _ ;
romanizer-d:
unchanged
# swap mapped consonant and seperator
part-5:
@consonant$1 ; => ; $1
romanizer-e:
unchanged
# duplicate the `fe`
part-6:
(@consonant @vowel)$1 => $1 $1 / ; _
romanizer-f:
unchanged
# remove the seperator
part-7:
; => *