Created
December 7, 2011 21:06
-
-
Save harms/1444658 to your computer and use it in GitHub Desktop.
Counting characters by kind.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
whitespace=: 9 10 32 { a. | |
vowel =: ( , toupper) 'aeiou' | |
consonant =: vowel -.~ a.{~ , 97 65 +"0 _ i.26 | |
other =: a. -. whitespace, vowel, consonant | |
kind=: whitespace; vowel; consonant; other | |
count=: ([: +/ ] e. >@[ )" _1 _ | |
kind count 'Some test text.' | |
2 4 8 1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment