Commit 4bd889e7 authored by Sylvain Schmitz's avatar Sylvain Schmitz

still testing chi square computations

parent ae466980
......@@ -60,3 +60,15 @@ benchmarks-xslt-full.xml: benchmarks-all-full.xml
grep -v 'type="xquery"' $< > $@
benchmarks-xquery-full.xml: benchmarks-all-full.xml
grep -v 'type="xslt"' $< > $@
contingency-size.dat: contingency-size.sh benchmarks-all-full.xml $(wildcard ../../benchmark/*-full.xml)
./contingency-size.sh `grep 'href' benchmarks-all-full.xml | sed -e 's/.*href="\([^"]*\).*/\1/'` > contingency-size.dat
chisquare-size: contingency-size.dat chisquare.R
./chisquare.R contingency-size.dat
contingency-axis-step.dat: contingency-axis-step.sh benchmarks-all-full.xml $(wildcard ../../benchmark/*-full.xml)
./contingency-axis-step.sh `grep 'href' benchmarks-all-full.xml | sed -e 's/.*href="\([^"]*\).*/\1/'` > contingency-axis-step.dat
chisquare-axis-step: contingency-axis-step.dat chisquare.R
./chisquare.R contingency-axis-step.dat
#!/bin/bash
# compute contingency table of benchmark results
# with rows = `accepted by at least one full fragment'
# and cols = `contains at least one axis step'
# using list of files provided on command-line
fragments=( `grep 'file=' ../../relaxng/fragments-full.xml | sed 's/.*file=\"\([\.a-zA-Z0-9\-]*.rnc\).*/\1/g'` )
accepted="@schema=\"${fragments[0]}\""
for ((f = 1; f < ${#fragments[@]}; ++f))
do
accepted="$accepted or @schema=\"${fragments[f]}\""
done
# first row: accepted
value=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[ast//xqx:xpathAxis and schemas/validation[$accepted and @valid=\"yes\"]])" $@`
printf "$value\t"value=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[not(ast//xqx:xpathAxis) and schemas/validation[$accepted and @valid=\"yes\"]])" $@`
printf "$value\t"
echo
# second row: not accepted
value=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[ast//xqx:xpathAxis and not(schemas/validation[$accepted and @valid=\"yes\"])])" $@`
printf "$value\t"
value=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[not(ast//xqx:xpathAxis) and not(schemas/validation[$accepted and @valid=\"yes\"])])" $@`
printf "$value\t"
echo
......@@ -4,7 +4,7 @@
# and cols = `query size'
# using list of files provided on command-line
MAX=20 #`grep 'MAX_AST_SIZE =' ../../src/main/java/fr/lsv/xpparser/XPathEntry.java| sed -e 's/[^0-9]*\([0-9]*\).*/\1/'`
MAX=`grep 'MAX_AST_SIZE =' ../../src/main/java/fr/lsv/xpparser/XPathEntry.java| sed -e 's/[^0-9]*\([0-9]*\).*/\1/'`
fragments=( `grep 'file=' ../../relaxng/fragments-full.xml | sed 's/.*file=\"\([\.a-zA-Z0-9\-]*.rnc\).*/\1/g'` )
accepted="@schema=\"${fragments[0]}\""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment