It finally showed up on the search.cpan.org site: http://search.cpan.org/~gslondon/Parse-Gnaw-0.600/
The test directory is a good place to see code samples: http://cpansearch.perl.org/src/GSLONDON/Parse-Gnaw-0.600/t/ The cool one is the test for parsing a two dimensional block of text: http://cpansearch.perl.org/src/GSLONDON/Parse-Gnaw-0.600/t/parse_xtreme_2d_string.t THere are some basics still missing from the parser. It doesnt have alternations yet. And it doesn't have all the character classes like \d, \w, and so on. But it's got the hard stuff figured out and appears to be working, so you can have a 2D block of text like abcd efgh ijkl mnop And you can parse for a sequence such as 'a','b','g','l' and it will find it. Once I get the rest of the basics in Parse::Gnaw, I think it might be possible to leverage it to do some sort of natual language processing. The thing that Parse::Gnaw parses is a linked list of "letter" objects. But the "letter" objects are pretty loosely defined, and because its a linked list, they can connect to anything they want in any structure they want. So, I think it might be possible to redefine the "letter" object to contain words and then have each word show up in the linked list as the various possible parts of speech that word might be. I have a ways to go, and quite a few basics to do yet, before I can start working on that, though. Greg > Hello, > > Well I finally got something uploaded to cpan for next meeting. > > Tuesday, May 14, 2013, MIT E51-376 7pm-10pm > > It's rev 0.600 of my parser module Parse::Gnaw > > > http://www.cpan.org/authors/id/G/GS/GSLONDON/ > > Parse-Gnaw-0.600.tar.gz > > > It is a revamping of the module. The previous version had > some issues like blowing up on recursive grammars. > > Version 0.600 solves this problem by rearchitecting the code. > > A cool new feature of the module: > > parsing multi-dimensional text blocks, not just one dimensional text. > > The following test creates a 2-D block of text and matches/doesn't match > patterns inside teh block. > > > > rule('abgl', 'a','b','g','l'); > rule('abcl', 'a','b','c','l'); > rule('afkp', 'a','f','k','p'); > rule('afki', 'a','f','k','i'); > > > # we're going to construct a basic 2-dimensional string linked list to > parse > # but we're not going to run a grammar on it. > # we're just going to see that the 2D linked list got created correctly. > > my $raw_2d_string=<<'RAWSTRING'; > abcd > efgh > ijkl > mnop > RAWSTRING > > my > $string1=Parse::Gnaw::LinkedListDimensions2->new(string=>$raw_2d_string); > my > $string2=Parse::Gnaw::LinkedListDimensions2->new(string=>$raw_2d_string); > my > $string3=Parse::Gnaw::LinkedListDimensions2->new(string=>$raw_2d_string); > my > $string4=Parse::Gnaw::LinkedListDimensions2->new(string=>$raw_2d_string); > > > > ok( $string1->parse('abgl'), "parse 2d string with abgl rule"); > ok(not($string2->parse('abcl')), "parse 2d string with abcl rule"); > ok( $string3->parse('afkp'), "parse 2d string with afkp rule"); > ok(not($string4->parse('afki')), "parse 2d string with afki rule"); > > > > > > > > _______________________________________________ > Boston-pm mailing list > [email protected] > http://mail.pm.org/mailman/listinfo/boston-pm > -- _______________________________________________ Boston-pm mailing list [email protected] http://mail.pm.org/mailman/listinfo/boston-pm

