Skip to content

Instantly share code, notes, and snippets.

@MattOates
Created May 9, 2015 06:50
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save MattOates/4c9b27980d59d021761e to your computer and use it in GitHub Desktop.
my %words;
given slurp("part-of-speech.txt") {
my int $pos = 0;
my int $chars = $_.chars;
while $pos < $chars {
my int $tab = $_.index("\t", $pos);
my int $nl = $_.index("\n", $tab);
%words{$_.substr($pos, $tab - $pos)} =
$_.substr($tab + 1, $nl - $tab - 1);
$pos = $nl + 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment