giellalt / giella-core

Build tools and build support files as well as developer support tools for the GiellaLT repositories.
https://giellalt.uit.no
GNU General Public License v3.0
7 stars 2 forks source link

Problem using --exclude in lemma testing #63

Open trondtynnol opened 1 month ago

trondtynnol commented 1 month ago

I have just noticed that the lemma generation test does not seem to like the --exclude option, at least not as it is used in the generate-POS-lemmas.sh scripts. For example, in lang-sma/src/fst/morphology/test, I get this error when running make devtest:

TEST: generate-noun-lemmas.sh
grep: unrecognized option '--exclude (CmpN/Only| R | Rreal |\+Gen\+|\+Der\+|\+CmpN\/Suff|\+Use\/MT)'
Usage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.

Digging a bit into this revealed that:

  1. --exclude should be used with =
  2. --exclude is used for excluding certain files, but we want to exclude certain patterns, so it is not suitable anyways.

Most guides suggest piping from grep into grep -v to exclude patterns, as grep does not do both (inclusion and exclusion matching) in a single run.

(I put this issue here as it concerns all the lang- repositories, not one in particular. Please move if it should rather be put under another repo.)

trondtynnol commented 1 month ago

@flammie

flammie commented 1 month ago

the exclude should be parsed by the script before it reaches grep actually, I think it just got doubled somewhere in the reorg,