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

Add lark and regex compilers to the python API #62

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

hudson-ai
Copy link
Collaborator

Adds LarkCompiler and RegexCompiler to the python API. Also changes the JsonCompiler slightly such that it returns a TopLevelGrammar rather than a GrammarWithLexer node, such that the output is "ready to consume" by an LLInterpreter.

@lochuynh1412 should make your life easier!

@hudson-ai
Copy link
Collaborator Author

@mmoskal currently both the Lark and the Regex compilers take no args on instantiation, so they feel pretty pointless at the moment. But I felt that having an API that is consistent with JSON (which does take args) was nice.

Open to suggestions for how to make this API nicer so that we don't get stuck with something ugly.

Copy link
Member

@mmoskal mmoskal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's OK to have the classes

@hudson-ai hudson-ai merged commit c5b02aa into microsoft:main Nov 22, 2024
2 checks passed
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