-
Notifications
You must be signed in to change notification settings - Fork 0
skotchandsoda/vowelcount
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
vc - count the vowels in a text file USAGE usage: vc [file] vc will read from standard input if no input file is specified. BACKGROUND A few months ago, an interviewer asked me to sketch up a way to count the number of vowels in an input file. Weeks later, I decided to go ahead and actually implement it. vc (i.e. "vowel count"), is the result. My idea essentially was to have an alphabet file that the program would read to determine what a "vowel" was, and then plow through the input file, character by character, incrementing its count as it went. The implementation currently just uses a lookup table because it's a bit faster. ISSUES Currently only supports ASCII input. BUILDING To build it, just run `make'. SEE ALSO Naturally, after spending an hour or two putting this together, I realized that one could very easily use `grep' to achieve the same result. To see this, try $ cat input_file | grep -e "[aeiou]" -o -i | wc -l Oh well. For really large inputs my program is faster.
About
Print the number of vowels in a file to standard output.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published