Diff of /run/bin/stats-mysql.sh [2e23dc] .. [d3657c]  Maximize  Restore

  Switch to side-by-side view

--- a/run/bin/stats-mysql.sh
+++ b/run/bin/stats-mysql.sh
@@ -61,16 +61,56 @@
 echo "<h1>${db}</h1>" >> ${outfile}
 
 mysql -u root --password=$MYSQLPASSWORD ${db} --html >> ${outfile} <<EOF
-select count(*) as log_count from logs;
+SELECT COUNT(*) AS log_count FROM logs;
 EOF
 
+# cardinality
 for domain in ${domains}; do
 echo "<h2>${domain}</h2>" >> ${outfile}
 eval tables=\$${domain}
 for t in ${tables}; do
 mysql -u root --password=$MYSQLPASSWORD ${db} --html <<EOF
-select "${t}" as ${domain}_table, count(*) as row_count from ${t};
+SELECT "${t}" AS ${domain}_table, COUNT(*) AS row_count FROM ${t};
 EOF
 done >> ${outfile}
 done
+
+# POS distribution
+echo "<h1>POS</h1>" >> ${outfile}
+echo "<h2>words</h2>" >> ${outfile}
+mysql -u root --password=$MYSQLPASSWORD ${db} --html >> ${outfile} <<EOF
+SELECT pos, COUNT(DISTINCT lemma) AS words_count FROM words JOIN senses USING (wordid) JOIN synsets USING (synsetid) GROUP BY pos
+EOF
+echo "<h2>senses</h2>" >> ${outfile}
+mysql -u root --password=$MYSQLPASSWORD ${db} --html >> ${outfile} <<EOF
+SELECT pos, COUNT(*) AS senses_count FROM senses JOIN synsets USING (synsetid) GROUP BY pos;
+EOF
+echo "<h2>synsets</h2>" >> ${outfile}
+mysql -u root --password=$MYSQLPASSWORD ${db} --html >> ${outfile} <<EOF
+SELECT pos, COUNT(*) AS synsets_count FROM synsets GROUP BY pos;
+EOF
+
+# link distribution
+echo "<h1>Links</h1>" >> ${outfile}
+echo "<h2>Semantic</h2>" >> ${outfile}
+mysql -u root --password=$MYSQLPASSWORD ${db} --html >> ${outfile} <<EOF
+SELECT linkid, link, s1.pos, s2.pos, COUNT(*) FROM semlinks AS l 
+INNER JOIN synsets AS s1 ON l.synset1id = s1.synsetid INNER JOIN synsets AS s2 ON l.synset2id = s2.synsetid 
+INNER JOIN linktypes USING (linkid)
+GROUP BY linkid, s1.pos, s2.pos
+ORDER BY linkid, s1.pos, s2.pos;
+EOF
+echo "<h2>Lexical</h2>" >> ${outfile}
+mysql -u root --password=$MYSQLPASSWORD ${db} --html >> ${outfile} <<EOF
+SELECT linkid, link, s1.pos, s2.pos, count(*) FROM lexlinks AS l 
+INNER JOIN words AS w1 ON l.word1id = w1.wordid INNER JOIN words AS w2 ON l.word2id = w2.wordid 
+INNER JOIN synsets AS s1 ON l.synset1id = s1.synsetid INNER JOIN synsets AS s2 ON l.synset2id = s2.synsetid 
+INNER JOIN linktypes USING (linkid)
+GROUP BY linkid, s1.pos, s2.pos
+ORDER BY linkid, s1.pos, s2.pos;
+EOF
+
 echo "</body></html>" >> ${outfile}
+
+
+

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks