Skip to content

Commit b05d9c2

Browse files
committed
update.
1 parent 44b69cd commit b05d9c2

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

proof/gramcheck/extracting-precision-sentences.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,14 @@ sed 's/$/"/' \
4242

4343
This command greps the tag from the positives.csv file. The sentence is at the end of the line. The number of fields may change from rule to rule, the command thus cuts the sentence from behind. The sentence is formatted so that it can be added to the yaml fileset in the `grammarchecker/tests` catalogue.
4444

45-
You may then make a list of all rule tags in the grammarchecker, search for each tag in `positives.csv` and store the result in one file for each tag, with a `for` loop. Copy the following (**Note** in the line beginning with `Variant:` you should exchange `smn` with the relevant language code), store it in misc, e.g. as candidates.sh, and run it (stand in `misc` and type the command `sh misc/candidates.sh`):
45+
You may then make a list of all rule tags in the grammarchecker,
46+
search for each tag in `positives.csv` and store the result in one
47+
file for each tag, with a `for` loop. First, make a list `taglist.txt`
48+
containing all error tags used in the file *grammarchecker.cg3* and
49+
store it in `misc`. Then copy the following (**Note** in the line
50+
beginning with `Variant:` you should exchange `smn` with the relevant
51+
language code), store it in misc, e.g. as candidates.sh, and run it
52+
(stand in `misc` and type the command `sh candidates.sh`):
4653

4754
```sh
4855
#!/bin/bash
@@ -61,10 +68,22 @@ Tests:' > ../tools/grammarcheckers/tests/candidates-$i.yaml
6168
done
6269
```
6370

71+
6472
### Integrating the result in regression testing
6573

66-
After having a look, store the sentences, e.g. (as for the example above) to a yaml file `tests/neg-posspl-ill-gen.yaml` file. Then you may test for regression, e.g. with `make check` or (file by file) with the usual command (standing in `tools/grammarchecker`):
74+
The resulting files are now stored in
75+
`tools/grammarchecker/tests/candidates-*.yaml` files, one for each
76+
tag. Some files may be empty (the smallest ones), delete them.. Then you
77+
may test for regression, e.g. with `make check` or (file by file) with
78+
the usual command (standing in `tools/grammarchecker`):
6779

6880
```sh
69-
gtgramtools test -c yaml tests/neg-posspl-ill-gen.yaml
81+
gtgramtools test -c yaml tests/candidates-neg-posspl-ill-gen.yaml
7082
```
83+
84+
The sentences you may then (throw away or) edit and store in
85+
`*-FAIL.yaml` (for false positives) or `*-PASS.yaml` (for true
86+
positives). The false positives should then be fixed by editing the
87+
rule file.
88+
89+

0 commit comments

Comments
 (0)