plint

French poetry validator (local mirror of https://gitlab.com/a3nm/plint)
git clone https://a3nm.net/git/plint/
Log | Files | Refs | README

train_diaeresis.sh (1421B)


      1 #!/bin/bash
      2 
      3 DIR="$( cd "$( dirname "$0" )" && pwd )"
      4 cd "$DIR"
      5 
      6 # use the verb diaeresis files if they exist
      7 if [ -f diaeresis_verbs/final_syneresis -a -f diaeresis_verbs/final_diaeresis ]
      8 then
      9   cat diaeresis_verbs/final_syneresis | grep -vE -- '-vous$|-nous$' |
     10     ./plint.py <(echo 12) ../data/diaeresis_empty.json final_syneresis.ctx 1 0
     11   cat diaeresis_verbs/final_syneresis | grep -E -- '-vous$|-nous$' |
     12     ./plint.py <(echo 12) ../data/diaeresis_empty.json final_syneresis2.ctx 1 1
     13   cat final_syneresis.ctx final_syneresis2.ctx | sponge final_syneresis.ctx
     14   cat diaeresis_verbs/final_diaeresis | grep -vE -- '-vous$|-nous$' |
     15     ./plint.py <(echo 12) ../data/diaeresis_empty.json final_diaeresis.ctx 2 0
     16   cat diaeresis_verbs/final_diaeresis | grep -E -- '-vous$|-nous$' |
     17     ./plint.py <(echo 12) ../data/diaeresis_empty.json final_diaeresis2.ctx 2 1
     18   cat final_diaeresis.ctx final_diaeresis2.ctx | sponge final_diaeresis.ctx
     19 fi
     20 
     21 # prepare the raw addition file
     22 for a in additions additions_quicherat
     23 do
     24   cut -d ' ' -f1 ${a}.txt > ${a}.tpl
     25   cut -d ' ' -f2- ${a}.txt > ${a}
     26 done
     27 
     28 # run the training
     29 FILES="andromaque mithridate boileau ../../additions ../../additions_quicherat cyrano$@"
     30 mkdir -p contexts
     31 rm -f contexts/*
     32 cp data/diaeresis_empty.json diaeresis0.json;
     33 for a in $(seq 0 4); do
     34   b=$(($a+1));
     35   ./onepass.sh $a ../diaeresis${a}.json $FILES > diaeresis${b}.json;
     36 done;
     37 cat diaeresis5.json