heatherleaf / mcfparser.py Goto Github PK
View Code? Open in Web Editor NEWEfficient parsing algorithms for Parallel Multiple Context-Free Grammars, written in Python
License: GNU General Public License v3.0
Efficient parsing algorithms for Parallel Multiple Context-Free Grammars, written in Python
License: GNU General Public License v3.0
Running python MCFParser.py
gives the following output:
**********************************************************************
File "MCFParser.py", line 85, in __main__.Parser
Failed example:
parser.print_grammar_statistics()
Expected:
Grammar statistics ||
-------------------|--------:|
Nr. terminals | 2 |
Nr. nonterminals | 2 |
Nr. nonterm-const. | 3 |
Nr. grammar rules | 3 |
Nr. constituents | 5 |
Nr. const. lengths | 12 |
Nr. empty const. | 0 |
Nr. leftc. pairs | 4 |
Nr. lcword. pairs | 2 |
Got:
Grammar statistics ||
-------------------|--------:|
Nr. terminals | 4 |
Nr. nonterminals | 2 |
Nr. nonterm-const. | 3 |
Nr. grammar rules | 3 |
Epsilon-free | True |
Nr. constituents | 5 |
Nr. const. lengths | 12 |
Nr. empty const. | 0 |
Nr. leftc. pairs | 4 |
Nr. lcword. pairs | 2 |
**********************************************************************
File "MCFParser.py", line 98, in __main__.Parser
Failed example:
parser.print_parse_statistics()
Exception raised:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/doctest.py", line 1289, in __run
compileflags, 1) in test.globs
File "<doctest __main__.Parser[6]>", line 1, in <module>
parser.print_parse_statistics()
File "MCFParser.py", line 304, in print_parse_statistics
print "%-11s|" % (hdr,) + "".join("%9s |" % (stat.get(key, "--"),) for key in statkeys)
File "MCFParser.py", line 304, in <genexpr>
print "%-11s|" % (hdr,) + "".join("%9s |" % (stat.get(key, "--"),) for key in statkeys)
TypeError: unhashable type: 'set'
**********************************************************************
1 items had failures:
2 of 7 in __main__.Parser
***Test Failed*** 2 failures.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.