Add number of meanings and examples statistic. Remove ru/uk statistic because
authorOleksandr Gavenko <gavenkoa@gmail.com>
Thu, 17 Nov 2016 22:43:11 +0200
changeset 681 13b9335eae0d
parent 680 a120543c98f4
child 682 4b03be057a46
Add number of meanings and examples statistic. Remove ru/uk statistic because they are same today.
Makefile
--- a/Makefile	Thu Nov 17 19:59:06 2016 +0200
+++ b/Makefile	Thu Nov 17 22:43:11 2016 +0200
@@ -593,31 +593,20 @@
 echo; \
 echo '.. class:: right'; \
 echo; \
-echo '=================================== ======='; \
-echo '        Dictionary                  Entries'; \
-echo '=================================== ======='; \
+echo '=================================== ======== ======== ========'; \
+echo '        Dictionary                  Articles Meanings Examples'; \
+echo '=================================== ======== ======== ========'; \
 total=0; \
 for dic in $(GADICT_FILES); do \
-  cnt=`grep '^__' $$dic | wc -l`; \
-  printf '%35s %7s\n' $${dic%.dict-c5} $$cnt; \
-  total=$$(($$total + $$cnt)); \
+  awk '\
+BEGIN { art=0; tr=0; ex = 0; };\
+/^__$$/{ art += 1 };\
+/^(en|ru|uk)> /{ ex += 1 };\
+/^(n|det|pron|adj|v|adv|prep|conj|num|int|phr|phr\.v|contr|abbr|prefix)$$/{ tr += 1 };'\
+"END {printf \"%35s %8s %8s %8s\n\", \"$${dic%.gadict}\", art, tr, ex};"\
+  <$$dic; \
 done; \
-printf '%35s %7s\n' '**Total**' $$total; \
-echo '=================================== ======='; \
-echo; \
-echo "Translations count"; \
-echo "=================="; \
-echo; \
-echo '.. class:: right'; \
-echo; \
-echo '==================== ============'; \
-echo '   gadict_en-ru+uk   Translations'; \
-echo '==================== ============'; \
-ru_tr=`grep '^ru: ' gadict_en-ru+uk.gadict | wc -l`; \
-uk_tr=`grep '^uk: ' gadict_en-ru+uk.gadict | wc -l`; \
-printf '%20s Ru\n' $$ru_tr; \
-printf '%20s Uk\n' $$uk_tr; \
-echo '==================== ============'; \
+echo '=================================== ======== ======== ========'; \
 } >$@
 
 dist/misc/: