Handbook
Glossary
syllables ( str -- n )
Vocabulary
text-analysis
.
private
Inputs
str
an
object
Outputs
n
an
object
Definition
USING:
kernel
math
math.order
regexp
sequences
unicode
;
IN:
text-analysis.private
:
syllables
( str -- n )
dup
length
1
=
[
drop
1
]
[
>lower
46
swap
remove
[
R/ [aeiouy]+/
count-matches
]
[
sub-syllable
[
matches?
]
with
count
-
]
[
add-syllable
[
matches?
]
with
count
+
]
tri
1
max
]
if
;