robmch / cyk-parser Goto Github PK
View Code? Open in Web Editor NEWA CYK parser written in Python 3.
License: MIT License
A CYK parser written in Python 3.
License: MIT License
Hi,
I want to use the following grammar which I have previously used in NLTK:
S -> L S | L
L -> 'A' F 'U' | 'A' | 'U' F 'A' | 'U' | 'C' F 'G' | 'C' | 'G' F 'C' | 'G'
F -> 'A' F 'U' | 'U' F 'A' | 'C' F 'G' | 'G' F 'C' | L S
Nothing -> None
But it shows an error for the sequence "ACCCUGGAU" that "The given sequence is not in the language produced by the grammar". How can I solve it?
Using the following grammar B C
is not recognised:
S -> A
B -> 'B'
C -> 'C'
A -> B C
Moving A -> B C
up seems to fix it:
S -> A
A -> B C
B -> 'B'
C -> 'C'
This is obviously a bug.
the grammar converter has a bug when a rule has more than 3 elements on the right hand side of the rule.
for example, this:
S -> A B C D M
converts to:
[['S', 'S2', 'MODEL'], ['S0', 'A', 'B', 'S1', 'S0', 'C', 'S2', 'S1', 'D'], ['A', "'I'"], ['B', "'w'"], ['D', "'d'"], ['C', "'l'"], ['M', "'m'"]]
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.