…/langr/rules/src.abbrevs.txt – zkratkycattrans.txt – mapování kategoriíe.cpd → latest/CZ180817ae.cpdjhtagset.txt → latest/CZ180817ag.txtkolokaceGC.win → kolokaceGC10.rev-sort.winkolokaceGC10.rev-sort.winlatest → /usr/local/CZ180817ax – poslední verze morfologielex_build_nosynth.cpd → latest/hgddCZ.cpdu.cpd → latest/CZ180817au.cpdw.cpd → latest/CZ180817aw.cpdlatest morfologii…/langr/rules/src změnit linky skriptem change_morph_version.sh.gc.x bez argumentů:/usr/local/langr/rules/bin/gc_ucs2_release.x Required arguments: --lex=<path> Accepted arguments: --input_file=<path> use given input file instead of stdin, ignored when not '--mode=single' --mode=(single|filter|batch) default is 'filter' --action=(gc|ma|disamb|disheu1|single|gcsingle|connect|listrules|tokenization) default is 'gc' --input=(plain|jh_vertical|wide_vertical|tokenized_vertical|jh_csts|wide_csts|tokenized_csts) default is 'plain' --output=(native|jh_vertical|wide_vertical|tokenized_vertical|tokenized_vertical_with_tp|jh_csts|wide_csts) default is 'native' --trace_deletions=(detailed|stat_used|stat_unused|stat_all|no) default is 'no' --morphological_guesser=(yes|no) default is 'no' --internal_guesser=(yes|no) default is 'no' --print_lemma_variant=(yes|no) default is 'no' --print_correct_sentences=(yes|no) default is 'no'; on gc/gcsingle with native output, print the correct sentences too --group=<group_name> unused by default, required with --action=single --user_abbrevs=<filename> list of user-defined abbrevs --empty_positions=(restore|keep|modified) default is 'keep', applies to any vertical output --collocations=(restore|keep|modified|modified_subst) default is 'keep' --ignore_rules=<filename> <filename> contains a list of '\n' separated variant identifiers These variants will be ignore during the operation. If not set, all rules are active. --verificator=(yes|no) default is 'yes'; if set to 'no', correction options are not checked for their correctness Current settings: TAG_LENGTH=23
--action=(gc|ma|disamb|disheu1|single|gcsingle|connect|listrules|tokenization)
Pro pravidla používáme pouze single spolu s group.
--group=<group_name>
Jméno skupiny pravidel, která se spouští.
--input=(plain|jh_vertical|wide_vertical|tokenized_vertical|jh_csts|wide_csts|tokenized_csts)
--output=(native|jh_vertical|wide_vertical|tokenized_vertical|tokenized_vertical_with_tp|jh_csts|wide_csts)
Vstup a výstup je wide_vertical nebo wide_csts (podle toho následuje-li nebo předchází-li frazrl).
--trace_deletions=(detailed|stat_used|stat_unused|stat_all|no)
detailed — napíše číslo pravidla do tagu <MMt>stat_used | stat_unused | stat_all — má vypsat, kolikrát se které pravidlo použilono--empty_positions=(restore|keep|modified)
restore — vrať všechny smazané tagykeep — nechej prázdné (nevyhovující, potřebujeme alespoň jeden tag)modified — vyznač smazání změnou varianty na velké písmeno--collocations=(restore|keep|modified|modified_subst)
restore — vrať původní tagykeep — ponechej tag D?modified — vrať původní tagy a vyznač kolokaci změnou varianty na malé písmenomodified_subst — ponechej tag D? a vyznač kolokaci změnou varianty na malé písmenovert-morf.-l <stat_used | stat_unused | stat_all>. Log jde do /tmp/errlog.log.$ extract-stat.pl < /tmp/errlog.log
V aktuálním adresáři vzniknou soubory stat.00001 až stat.nnnnn.
#!/usr/bin/perl my $cnt=0; my $stat=0; my $fname="stat"; my $fh; while ($radek = <STDIN>) { if ($radek =~ /= STATISTICS/) { $cnt++; $stat=1; $fname="stat." . sprintf("%05d",$cnt); print STDERR "$fname\n"; open($fh,">",$fname); } elsif ($radek =~ /= END/) { $stat=0; close($fh); } elsif ($stat eq 1) { if ($radek !~ /^Tags/) { print $fh $radek; } } }
root0), zjistíme příkazem$ /disk3/rules/bin/gc.x --lex=/corp/LEX --action=listrules --group=root0 2> ~/tmp/ROOT0
$ get-stat.sh > STAT
#!/bin/bash for w in $(cat ROOT0); do let c1=$(fgrep -h -w $w stat.* | cut -f1 | xargs | tr ' ' '+' | bc) let c2=$(fgrep -h -w $w stat.* | cut -f2 | xargs | tr ' ' '+' | bc) let c3=$(fgrep -h -w $w stat.* | cut -f3 | xargs printf '%.0f\n' | xargs | tr ' ' '+' | bc) printf "%9.0f\t%9.0f\t%9.0f\t%s\n" "$c1" "$c2" "$c3" "$w"; done
<pocet_vet> <pocet_tokenu> <pocet_tagu> root v /usr/local/langr/rules/binbldlex.sh v adresáři /usr/local/langr/rules/bin:env BASEDIR=/usr/local/langr/rules USE_MORPHOLOGY=none \ TAGSET_OUR=~skoumal/PROJEKTY/INFRASTRUKTURA/morfologie/MFF-spoluprace/tagset_our.txt.CZ20170531 \ TAGSET_OUR_UNKNOWN=~skoumal/PROJEKTY/INFRASTRUKTURA/morfologie/MFF-spoluprace/tagset_our_unknown.txt.CZ20170531 \ COLLOCATIONS=/usr/local/langr/rules/src/kolokaceGC.win ICONV_IN_CHARSET=CP1250 \ USER_DIR=/usr/local/langr/rules/linguists/hanka/modules/ ./bldlex.sh
env BASEDIR=/usr/local/langr/rules USE_MORPHOLOGY=none \ INTERACTIVE=0 \ TAGSET_OUR=/usr/local/langr/rules/src/ourtags.txt \ TAGSET_OUR_UNKNOWN=/usr/local/langr/rules/src/ourtags_unkn.txt \ COLLOCATIONS=/usr/local/langr/rules/src/kolokaceGC.win \ ICONV_IN_CHARSET=CP1250 \ USER_DIR=/usr/local/langr/rules/linguists/hanka/modules/ \ PROCESS_GROUPS="-i root -i heuristika1" \ CATTRANS=/usr/local/langr/rules/src/cattrans.txt.new \ COMPILER=/usr/local/langr/rules/bin/compiler_ucs2_release.x ./bldlex.sh
vert-vrbtg8--empty_positions=modified a --collocations=modified:parallel-filter.sh -C "${SYN2020_PREFIX}/bin/gc_ucs2_release.x \
--lex=${SYN2020_PREFIX}/LEX_ucs2 --action=single --input=wide_vertical --output=wide_vertical \
--empty_positions=modified --collocations=modified --trace_deletions=stat_all --group=root" \
-s vert-vrbtg8 -t /dev/null -v -p10 2>>errlog/rules_stat.log
errlog/rules_stat.log obsahuje veškerý výstup, který šel na STDERR. Musíme vypreparovat statistiky a poskládat je dohromady:extract-stat.pl < errlog/rules_stat.log | sort -k4 | count-stat.pl > rules-stat.log
a setřídit seznam podle počtu použití:
sort -n -k2 rules-stat.log > rules-stat.srt