Count how many vowels and consonants occur in a string: Difference between revisions

Content added Content deleted
Line 237: Line 237:
then t
then t
else f</lang>
else f</lang>
{{Out}}
<pre>Unique vowels and consonants used, with counts:
<pre>Unique vowels and consonants used, with counts:


Line 291: Line 292:
('\t' :)
('\t' :)
( [ show vTotal
( [ show vTotal
<> " instances of "
<> " characters drawn from "
<> show (length v)
<> show (length v)
<> " vowels:"
<> " vowels:"
Line 297: Line 298:
<> (('\t' :) . show <$> v)
<> (('\t' :) . show <$> v)
<> [ "",
<> [ "",
show cTotal <> " instances of "
show cTotal <> " characters drawn from "
<> show (length c)
<> show (length c)
<> " consonants:"
<> " consonants:"
Line 309: Line 310:
both = join bimap</lang>
both = join bimap</lang>
{{Out}}
{{Out}}
<pre>33 'vowels and consonants'
<pre>33 "vowels and consonants"

12 characters drawn from 5 vowels:
('a', 4)
('e', 3)
('i', 1)
('o', 3)
('u', 1)


12 instances of 5 vowels:
21 characters drawn from 9 consonants:
('a',4)
('a', 4)
('e',3)
('e', 3)
('i',1)
('i', 1)
('o',3)
('o', 3)
('u',1)
('u', 1)</pre>
21 instances of 9 consonants:
('F',2)
('g',4)
('l',1)
('m',2)
('n',3)
('p',1)
('r',6)
('t',1)
('v',1)</pre>


=={{header|jq}}==
=={{header|jq}}==