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

Autocorrect mode for divvun-checker #37

Open
snomos opened this issue Jan 30, 2020 · 4 comments
Open

Autocorrect mode for divvun-checker #37

snomos opened this issue Jan 30, 2020 · 4 comments
Assignees

Comments

@snomos
Copy link
Member

snomos commented Jan 30, 2020

For automatised tests where we only care about whether we got the expected output, it would be nice to have an autocorrect mode. That is, the tool should take the input text, find possible errors, apply the best/first suggestion in each case, and print out the corrected text. The output should be identical to the input text except for the corrections made.

One could consider a sub-option for whether to do single-pass or multipass corrections, ie whether to try to find more errors after the first pass until no more errors are found. Default should be single-pass.

unhammer added a commit that referenced this issue Jan 30, 2020
Implements #37 - Autocorrect mode for divvun-checker
@unhammer
Copy link
Member

unhammer commented Jan 30, 2020

git fetch
git checkout 37-autocorrect 
make -j4 
src/divvun-suggest --autocorrect test/suggest/generator.hfstol test/suggest/errors.xml < test/suggest/input.badjel.cg 

gives
sáddejuvvot báhpirat interneahta bokte.

(json was {"errs":[["badjel",33,39,"lex-bokte-not-badjel","boasttut sátni",["bokte"],"\"bokte\" iige \"badjel\""]],"text":"sáddejuvvot báhpirat interneahta badjel.\n")
something like that?

@snomos
Copy link
Member Author

snomos commented Jan 30, 2020

Yes, looks good.

unhammer added a commit that referenced this issue Jan 30, 2020
Implements #37 - Autocorrect mode for divvun-checker
@unhammer
Copy link
Member

unhammer commented Mar 10, 2022

Can this one be closed, or should we do a multipass / "fixed-point" option too?

@snomos
Copy link
Member Author

snomos commented Mar 11, 2022

It would be nice to have a multipass option too, so that the output would be "the most correct text according to the grammar checker". It should be easy to implement - just loop over the input untill there are no more changes.

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

No branches or pull requests

2 participants