Created
November 22, 2013 07:39
-
-
Save soren/7596270 to your computer and use it in GitHub Desktop.
A Perl Word Count mapper script. Can be used as a mapper in Hadoop using the Streaming interface. Tested with Java 1.6 and Hadoop 1.0.4.
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
#!/usr/bin/env perl | |
use warnings; | |
use strict; | |
while (<>) { | |
chomp; | |
print lc $_,"\t1\n" foreach split /[\s.,:;!?]+/; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment