[REBOL] Re: [REBOL parse] Parsing AEIOU and sometimes Y
From: lmecir::mbox::vol::cz at: 3-May-2007 8:58
Ladislav Mecir napsal(a):
sorry, I succeeded to swap the charset definition, here is a correction:
; vowel variants
vowel-after-consonant: charset "aeiouyAEIOUY"
vowel-otherwise: charset "aeiouAEIOU"
; consonant variants
consonant-after-consonant: exclude charset [
#"a" - #"z" #"A" - #"Z"
] vowel-after-consonant
consonant-otherwise: union consonant-after-consonant charset "yY"
; adjusting the Vowel and Consonant rules to the Otherwise state
otherwise: first [
(
; vowel detection does not change state
vowel: vowel-otherwise
; consonant detection changes state to After-consonant
consonant: [consonant-otherwise after-consonant]
)
]
; adjusting the Vowel and Consonant rules to the After-consonant state
after-consonant: first [
(
; vowel detection provokes transition to the Otherwise state
vowel: [vowel-after-consonant otherwise]
; consonant detection does not change state
consonant: consonant-after-consonant
)
]
rule: [
; initialization
(
; zeroing the counter
m: 0
)
; setting the state to Otherwise
otherwise
; initialization end
any consonant
any [some vowel some consonant (m: m + 1)]
any vowel
]
-L