@@ -890,15 +890,16 @@ cohort. There is no way from this output to know that "dego" should
890
890
not also be deleted from the ` SUGGEST ` reading.
891
891
892
892
So when there are such multiple alternative interpretations for errors
893
- spanning multiple words, the less central parts ("dego" above) need a
894
- "co-error tag" (using ` co& ` as a prefix instead of ` & ` ) to say which
895
- error tag goes with which non-central reading.
893
+ spanning multiple words, the less central parts ("dego" above) also
894
+ need a matching error tag to say which error tag goes with which
895
+ non-central or suggestion reading. We often use the ` co& ` prefix
896
+ instead of ` & ` which indicates that this is not the main reading of
897
+ the complex error:
896
898
897
899
ADD (co&syn-not-dego) ("dego") IF (1 (&syn-not-dego));
898
900
899
- Without the ` co ` , this would be treated as a separate error, while
900
- without ` &syn-not-dego ` , we would suggest deleting this word in
901
- the suggestions for ` &syn-dego-nom ` too.
901
+ Without ` co&syn-not-dego ` , we would suggest deleting "dego" in the
902
+ suggestions for ` &syn-dego-nom ` too.
902
903
903
904
By using ` co&error-tags ` , we can have multiple alternative
904
905
interpretations of an error, while avoiding generating bad
@@ -965,6 +966,20 @@ In this sentence in South Sámi there are two alternative suggestions:
965
966
Here too, we need to ensure that there are ` co&errortags ` to match
966
967
relations to readings.
967
968
969
+ Often we change all ` &error ` tags to ` co&error ` tags at the end of a
970
+ rule section:
971
+
972
+ ```
973
+ SUBSTITUTE (&syn-kánske) (co&syn-kánske) TARGET (SUGGEST) ;
974
+ MAP:LOCK_READING (SUGGEST) (SUGGEST); # avoid rules looping
975
+ ```
976
+
977
+ This is so we can have a
978
+ ` LIST Errors = &syn-kánske &syn-soahtit-vfin+inf &etc; `
979
+ that will not match the suggestions (the
980
+ suggestions are correct, so they should not be matched by the ` Errors `
981
+ set).
982
+
968
983
969
984
## Avoiding mismatched words in multiple suggestions on ambiguous readings
970
985
@@ -1281,6 +1296,19 @@ but is recommended in case we can have several error types and need to
1281
1296
keep replacements separate (to avoid silly combinations of
1282
1297
suggestions).
1283
1298
1299
+ Another use for the ` co&errtag ` is to have a way to relate corrected
1300
+ ` SUGGEST ` readings within complex errors, without the correct reading
1301
+ being matched by sets which look for error tags. For example, say that
1302
+ you have a ` LIST Errors = &missing &typo …; ` and a rule which looks
1303
+ for an error-tagged pronoun to the left ` (-1 Pron + Errors) ` . Now
1304
+ earlier in the grammar checker rules you may have added a new
1305
+ suggestion cohort with a reading ` Pron SUGGEST ` – if you gave that
1306
+ reading the tag ` &missing ` to relate it to the central word, the
1307
+ context ` (-1 Pron + Errors) ` would match, which is probably not what
1308
+ you want. But if you instead give the suggestion the tag ` co&missing ` ,
1309
+ then you can rely on tags like ` &missing ` being only on actual
1310
+ mistakes in the input.
1311
+
1284
1312
When we have a ` DELETE ` relation from a reading with an ` &errtag ` and
1285
1313
there are be multiple source-cohort error tags, the deletion target
1286
1314
needs to have a ` co&errtag ` , so that we only delete in the replacement
@@ -1355,11 +1383,14 @@ don't conflict with the below special tags.
1355
1383
See [ Including spelling errors] ( #org26182db ) .
1356
1384
- ` <spelled> ` is added by ` divvun-cgspell ` to any suggestions it
1357
1385
makes. See [ Including spelling errors] ( #org26182db ) .
1358
- - ` co& ` is a tag prefix – ` co& ` marks a reading as a non-central
1359
- part of the underline of ` &errtag ` , see [ Deleting words] ( #org4d2c8ef )
1360
- and related sections. (You may also see ` COERROR &errtag ` or `&LINK
1361
- &errtag` in older rules; this was the old way of writing
1362
- ` co&errtag ` .)
1386
+ - ` co& ` is a tag prefix – ` co& ` is often used to mark a reading as a
1387
+ non-central part of the underline of ` &errtag ` , see [ Deleting
1388
+ words] ( #org4d2c8ef ) and related sections. (You may also see
1389
+ ` COERROR &errtag ` or ` &LINK &errtag ` in older rules; this was the
1390
+ old way of writing ` co&errtag ` .) We also often add ` co& ` error
1391
+ tags to ` SUGGEST ` readings in order to relate a suggestion to a
1392
+ complex error without that (correct) reading being matched by sets
1393
+ which match error readings.
1363
1394
- ` &ADDED ` means this cohort was added (typically with ` ADDCOHORT ` )
1364
1395
and should be a part of the suggestion for the error. It will appear
1365
1396
after the blank of the preceding cohort, and will not be the central
0 commit comments