divvun / libdivvun

lib for running gramcheck and other pipelines + cli; modules for CG→spelling, CG→feedback, tagging blanks
https://giellalt.github.io/proof/gramcheck/GrammarCheckerDocumentation.html
GNU General Public License v3.0
9 stars 1 forks source link

support for altering forms of two COERROR'd cohorts #61

Closed unhammer closed 1 year ago

unhammer commented 1 year ago
"<ta>"
    "ta" V <W:0> @V &syn-phrasal-verb ID:1
    "spille" V <W:0> @V &syn-phrasal-verb &SUGGEST ID:1 R:RIGHT:2
:
"<opp>"
    "opp" Adv <W:0> @Adv &syn-phrasal-verb ID:2 &COERROR
    "inn" Adv <W:0> @Adv &SUGGEST ID:2 &COERROR

should give suggestion "spille inn", currently just gives "spille"

unhammer commented 1 year ago

@lynnda-hill this should work when the next libdivvun build is done (tomorrow hopefully). Also you can use &COERROR instead of &LINK:

$ cat test/suggest/input.taopp.cg
"<ta>"
        "ta" V Inf <W:0> @V &syn-phrasal-verb ID:1
        "spille" V Inf <W:0> @V &syn-phrasal-verb &SUGGEST ID:1 R:RIGHT:2
:
"<opp>"
        "opp" Adv <W:0> @Adv &syn-phrasal-verb ID:2 &COERROR
        "inn" Adv <W:0> @Adv &syn-phrasal-verb &SUGGEST ID:2 &COERROR

$ cat test/suggest/input.taopp.cg |src/divvun-suggest -j -m test/suggest/errors.xml -g test/suggest/generator.hfstol |jq
{
  "errs": [
    [
      "ta opp",
      0,
      6,
      "syn-phrasal-verb",
      "\"ta\" maŋis galggašii leat blah",
      [
        "spille inn"
      ],
      "Cealkkameattáhus"
    ]
  ],
  "text": "ta opp"
}

Still TODO: input casing not yet carried over ("Ta opp" gives suggestion "spille inn" instead of "Spille inn")