#Minimal Spanish transducer: changes almost nothing define Punc [%.|%,|%¡|%!|%¿|%?|%"]; define Tone [1|2|3|4]; define TP Tone+; define DelTone %( Tone %) ; define TG [ DelTone | TP (DelTone) ] ; define Cons [b|c|d|f|g|h|j|k|l|m|n|p|q|r|s|t|v|w|x|y|z|ñ]; define NCon [n|m|ñ]; #Remove punctuation and material within brackets #define StripPunc Punc+ @-> 0 || .#. _ ? .o. # Punc+ @-> 0 || ? _ .#. .o. # %[ %. %. %. %] -> UNINT .o. define StripPunc %[ %. %. %. %] -> UNINT .o. ?+ @> 0 || %[ _ %] .o. # %[ %] -> 0 || ? _ .o. # %[ %] -> 0 || _ ? .o. # %[ %] -> %[ %. %. %. %] .o. %[ %] -> 0 .o. UNINT -> %[ %. %. %. %] ; #Convert vowel + "n" into nasalized segments ãẽĩõũ in enclitics define NasVowels a n -> ã || %= Cons* _ TG ,, e n -> ẽ || %= Cons* _ TG ,, i n -> ĩ || %= Cons* _ TG ,, o n -> õ || %= Cons* _ TG ,, u n -> ũ || %= Cons* _ TG ; define NasVowels2 a -> ã || %= NCon _ TG ,, e -> ẽ || %= NCon _ TG ,, i -> ĩ || %= NCon _ TG ,, o -> õ || %= NCon _ TG ,, u -> ũ || %= NCon _ TG ; define RmEqual %= -> 0; regex StripPunc; regex NasVowels; regex NasVowels2; regex RmEqual; save stack minspanb.fbin