Commit de708ebd authored by Sylvain Schmitz's avatar Sylvain Schmitz

chi squared analysis by size and axes

parent 4bd889e7
......@@ -27,7 +27,7 @@ axis-count.tex: $(wildcard ../../benchmark/*-axis-step.xml)
./axis-count.sh > axis-count.tex
dist.dat: $(wildcard ../../benchmark/*-full.xml)
./distribution.sh > dist.dat
./distribution.sh 1 > dist.dat
captured_dist.dat: $(wildcard ../../benchmark/*-full.xml)
./captured_distr.sh > captured_dist.dat
captured_dist.pdf: captured_dist.dat captured_dist.tex
......
......@@ -6,6 +6,8 @@ contingency = read.table(args[1])
library(MASS)
chisq.test(contingency)
res <- chisq.test(contingency)
res
q(status=0)
......@@ -6,20 +6,44 @@
fragments=( `grep 'file=' ../../relaxng/fragments-full.xml | sed 's/.*file=\"\([\.a-zA-Z0-9\-]*.rnc\).*/\1/g'` )
accepted="@schema=\"${fragments[0]}\""
full="(@schema=\"${fragments[0]}\")"
for ((f = 1; f < ${#fragments[@]}; ++f))
do
accepted="$accepted or @schema=\"${fragments[f]}\""
full="$full 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\"]])" $@`
value=0
for file in $@
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[(ast//xqx:xpathAxis) and (schemas/validation[($full) and @valid=\"yes\"])])" $file`
value=$((count + value))
done
printf "$value\t"
value=0
for file in $@
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[not(ast//xqx:xpathAxis) and (schemas/validation[($full) and @valid=\"yes\"])])" $file`
value=$((count + value))
done
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\"])])" $@`
value=0
for file in $@
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[(ast//xqx:xpathAxis) and not(schemas/validation[($full) and @valid=\"yes\"])])" $file`
value=$((count + value))
done
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\"])])" $@`
value=0
for file in $@
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[not(ast//xqx:xpathAxis) and not(schemas/validation[($full) and @valid=\"yes\"])])" $file`
value=$((count + value))
done
printf "$value\t"
echo
......@@ -6,24 +6,50 @@
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'` )
step=4
cutoff=48
accepted="@schema=\"${fragments[0]}\""
full="(@schema=\"${fragments[0]}\")"
for ((f = 1; f < ${#fragments[@]}; ++f))
do
accepted="$accepted or @schema=\"${fragments[f]}\""
full="$full or (@schema=\"${fragments[f]}\")"
done
# first row: accepted
for ((i = 1; i < $MAX; ++i))
for ((i = 1; i < $cutoff; i+=$step))
do
value=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[ast/@size=\"$i\" and schemas/validation[$accepted and @valid=\"yes\"]])" $@`
value=0
for file in $@
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[(ast[@size >= $i and @size < ($i+$step)]) and (schemas/validation[($full) and @valid=\"yes\"])])" $file`
value=$((count + value))
done
printf "$value\t"
done
value=0
for file in $@
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[(ast[@size >= $cutoff]) and (schemas/validation[($full) and @valid=\"yes\"])])" $file`
value=$((count + value))
done
printf "$value\t"
echo
# second row: not accepted
for ((i = 1; i < $MAX; ++i))
for ((i = 1; i < $cutoff; i+=$step))
do
value=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[ast/@size=\"$i\" and not(schemas/validation[$accepted and @valid=\"yes\"])])" $@`
value=0
for file in $@
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[(ast[@size >= $i and @size < ($i+$step)]) and not(schemas/validation[($full) and @valid=\"yes\"])])" $file`
value=$((count + value))
done
printf "$value\t"
done
value=0
for file in $@
do
count=`xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(//xpath[(ast[@size >= $cutoff]) and not(schemas/validation[($full) and @valid=\"yes\"])])" $file`
value=$((count + value))
done
printf "$value\t"
echo
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