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

Cleaner constructor #3

Merged
merged 10 commits into from
Nov 22, 2023

Conversation

lucasoshiro
Copy link
Contributor

Hi!
First of all, thanks @mahdavipanah for this lib, this helped my a lot when I was studying context-free grammars.

However, I that this could be a easier to use, with a cleaner and more flexible constructor, like this:

from cfg import CFG

g = CFG(terminals={'a', 'b', 'c', 'λ'},
        rules={'S': ['aSa', 'bSb', 'cSc', 'λ']}
        )

I've implemented this in this code for my personal use, I thought it would be fair to share it with you. This is still compatible with the current constructor.

Tests are included to make sure that everything is ok.

@mahdavipanah
Copy link
Owner

@lucasoshiro I'm glad that this project has been useful for you. I'm sorry for not getting back to you sooner, but this project is from a couple of years ago and I don't have the time to maintain it anymore. I appreciate your pull request. If you can take a look at these issues and potentially create a pull request to fix them, it would be awesome:

@mahdavipanah mahdavipanah merged commit 749370c into mahdavipanah:master Nov 22, 2023
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

Successfully merging this pull request may close these issues.

2 participants