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

started implementing chi square test

parent 56105a8e
#!/usr/bin/Rscript
# compute Pearson's chi square of the contingency table provided as arg1
args <- commandArgs(TRUE)
contingency = read.table(args[1])
library(MASS)
chisq.test(contingency)
q(status=0)
#!/bin/bash
# compute contingency table of benchmark results
# with rows = `accepted by at least one full fragment'
# 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/'`
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
for ((i = 1; i < $MAX; ++i))
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\"]])" $@`
printf "$value\t"
done
echo
# second row: not accepted
for ((i = 1; i < $MAX; ++i))
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\"])])" $@`
printf "$value\t"
done
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