Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am llamasoft on github.
  • I am llamasoft (https://keybase.io/llamasoft) on keybase.
  • I have a public key ASCjasuNkOapoGGjEQ0f6CsGhn5hJcXGqW8i100XUUn_pwo

To claim this, I am signing this object:

@llamasoft
llamasoft / wordnet_parse.pl
Created December 6, 2016 18:14
Princeton WordNet Parser Short Example
#!/usr/bin/perl
while (my $line = <>) {
# If no 8-digit byte offset is present, skip this line
if ( $line !~ /^[0-9]{8}\s/ ) { next; }
chomp($line);
my @tokens = split(/ /, $line);
shift(@tokens); # Byte offset
shift(@tokens); # File number
@llamasoft
llamasoft / wordnet_parse.pl
Created December 6, 2016 18:14
Princeton WordNet Database Parser Example
#!/usr/bin/perl
use strict;
use warnings;
# Parses a synonym set line from a data.* file into a Synset hash
sub parse_synset($) {
my $line = shift(@_);