Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing cf-gammars without probabilities #13

Open
roddar92 opened this issue Oct 24, 2019 · 2 comments
Open

Writing cf-gammars without probabilities #13

roddar92 opened this issue Oct 24, 2019 · 2 comments

Comments

@roddar92
Copy link

Dear colleagues,

I'm exploring a good Earley parsers for writing cf-grammars, and this one seems to be friendly for me. Could you tell please, does this parser allow to write cf-grammars without probabilities setting?

P.S. I need Java parser like Lark (Python) for directly rule writing.

Thanks,
Daria

@digitalheir
Copy link
Owner

digitalheir commented Oct 24, 2019

Dashka,

It is possible if you set all rule probabilities equal to each other, or just ignore the computed probabilities. The parse trees are the same.

If you just need to parse a little and performance is not critical, this library should work just fine. However, this software does not implement all optimizations that are possible for non-probabilistic CFGs, because the probabilities pose some limitations on that. So I cannot make certain efficiency guarantees that a project like Marpa does. As far as I've seen, Marpa is the best non-probabilistic CFG parser out there in terms of efficiency but not possible to use with Java (sadly).

Maarten

@digitalheir
Copy link
Owner

digitalheir commented Oct 24, 2019

Just a heads up in case you run into a strange error about a singular matrix.

You (maybe) need to make sure that the sum of probabilities for any given goal does not exceed 1.0, or you might end up with an error. Strictly speaking, this is an error on the side of the grammar authour, but my software could be more friendly about it. I intended the software to spot this error and normalize the probabilities so they add up to 1, but I forgot if I ever released it.

This is the issue that described the situation: #12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants