-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add with-nlg
option for serializing NLG output
#140
base: main
Are you sure you want to change the base?
Conversation
--nlg-only
288a190
to
b9c08b3
Compare
--nlg-only
with-nlg
option for serializing NLG output
I have revised the CLI so that it's a |
@inariksit when you have time, would you be willing to test this out a bit? If it works, then the only thing that needs to be done before we can merge this would be to refactor the lens stuff in the Render module to use optics instead of lens where possible (as per the convention in the rest of the codebase). There's an example of how this can be done in Main.hs, I think, but I can also do this refactoring if you would prefer that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As noted in a comment on the PR, there are two things that should be done:
- Some testing of my latest changes to the CLI
- Refactor lens stuff in Render to use optics where possible (I think there's an example of this in Main.hs)
When testing, make sure that your .env includes the following lines:
COMPILED_SIMALA_OUTPUT_DIR="generated/simala"
NLG_EN_OUTPUT_DIR="generated/nlg_en"
NLG_EN_OUTPUT_FILENAME="nlg_en_output.json"
GF_PORTABLE_GRAMMAR_FORMAT_FILENAME="Lam4.pgf"
@ym-han With refactoring lens to use optics, do you mean this one-liner function? https://github.com/smucclaw/lam4/blob/nlg-output/lam4-backend/src/Lam4/Render/Render.hs#L90 The most similar line in Main.hs I'm seeing is this https://github.com/smucclaw/lam4/blob/nlg-output/lam4-cli/app/Main.hs#L191 , which uses the function This is the commit in October where I switched from PCRE to Lens-regexes, would you prefer me to restore the change? f6aa458 |
I got the impression that this was needed for @Meowyam to get the NL output to display in the other window.
Two things:
generated/nlg_en/output.txt
--nlg-only
: only NL output is printed to stdout.Example run: