Skip to content

Commit

Permalink
rydding
Browse files Browse the repository at this point in the history
  • Loading branch information
Trondtr committed Nov 2, 2023
1 parent 5c80fde commit 5203304
Showing 1 changed file with 25 additions and 18 deletions.
43 changes: 25 additions & 18 deletions tools/grammarcheckers/grammarchecker.cg3
Original file line number Diff line number Diff line change
Expand Up @@ -54,43 +54,46 @@ INCLUDE ../../src/cg3/tagdeclaration.cg3 ;
#!! Declare tags not declared in disambiguation.cg3
#!! (TODO: Perhaps they should have been declared there as well)

LIST QAR = QAR ; #!!= * @CODE@
LIST QAR = QAR ; #!!= - @CODE@

#!! ### Tags used only here

LIST QMARK = QMARK ; #!!= * @CODE@
LIST QMARK = QMARK ; #!!= - @CODE@

#!! ## Grammarchecker tags

LIST &ellipsis = &ellipsis ;
LIST &guillemets = &guillemets ;
LIST &typo = &typo ;
LIST &msyn-arg-trm-ins = &msyn-arg-trm-ins ;
MAPPING-PREFIX = & ;
LIST &ellipsis = &ellipsis ; #!!= - @CODE@
LIST &guillemets = &guillemets ; #!!= - @CODE@
LIST &typo = &typo ; #!!= - @CODE@
LIST &msyn-arg-trm-ins = &msyn-arg-trm-ins ; #!!= - @CODE@
MAPPING-PREFIX = & ; #!!= - @CODE@


#!! ## Rule section

SECTION

# Speller suggestions rule – add &SUGGESTWF to any spelling suggestion
# that we actually want to suggest to the user.
# The simplest is to just add it to all spelled words:
#!! ### Speller suggestions rule
#!! add &SUGGESTWF to any spelling suggestion
#!! that we actually want to suggest to the user.
#!! The simplest is to just add it to all spelled words:

ADD:spell-it-all (&typo &SUGGESTWF) (<spelled>) ;
#!! @RULENAME@
# But perhaps you want to only suggest spellings of words that are not inside "quotes":

#!! But perhaps you want to only suggest spellings of words that are not inside "quotes":

ADD:spell-conservatively (&typo &SUGGESTWF) (<spelled>) IF (NEGATE -1 QMARK LINK 2 QMARK);
#!! @RULENAME@

# A simple grammar checker rule without suggestions: Ensure preceding nominal agrees with the verb
# ADD:msyn-agr (&msyn-agr) TARGET V IF (-1C Sg + Nom) (0 V) (NOT 0 Sg3);
# ADD:msyn-agr (&msyn-agr) TARGET V IF (-1C Pron + Sg1 + Nom) (0 V) (NOT 0 Sg1);
# ADD:msyn-agr (&msyn-agr) TARGET V IF (-1C Pron + Sg2 + Nom) (0 V) (NOT 0 Sg2);
# ADD:msyn-agr (&msyn-agr) TARGET V IF (-1C Pron + Pl1 + Nom) (0 V) (NOT 0 Pl1);
# ADD:msyn-agr (&msyn-agr) TARGET V IF (-1C Pron + Pl2 + Nom) (0 V) (NOT 0 Pl2);

#!! ### Grammatical rules

#!! #### Verb valency rules

ADD:msyn-arg-trm-ins (&msyn-arg-trm-ins) TARGET N + Trm + Sg IF (1 QAR);
#!! @RULENAME@

COPY:msyn-arg-trm-ins (Ins Sg &SUGGEST) EXCEPT (Trm Sg &msyn-arg-trm-ins) TARGET (&msyn-arg-trm-ins);
#!! @RULENAME@

Expand All @@ -106,7 +109,11 @@ COPY:msyn-arg-trm-ins (Ins Sg &SUGGEST) EXCEPT (Trm Sg &msyn-arg-trm-ins) TARGE
# tag too – &-prefixed error tags are ignored when generating, but
# used to create human-readable messages.

# Simple punctuation rules showing how to change the lemma in the suggestions:
#!! ### Simple punctuation rules

#!! Rules for quotation marks.


ADD:use-guillemets (&guillemets) TARGET (""");
#!! @RULENAME@
COPY:left-guillemet ("«" &SUGGEST) EXCEPT (""") TARGET (&guillemets) ;
Expand Down

0 comments on commit 5203304

Please sign in to comment.