March 2014 update
This commit is contained in:
parent
09687c4926
commit
a25938f123
1846 changed files with 21876 additions and 5203 deletions
|
|
@ -1,14 +1,27 @@
|
|||
#!/bin/sh
|
||||
|
||||
matched() {
|
||||
egrep "$1" unixdict.txt | wc -l
|
||||
grep -Poe "$1" unixdict.txt | wc -l
|
||||
}
|
||||
|
||||
check() {
|
||||
if [ $(expr $(matched $3) \> $(expr 2 \* $(matched $2))) = '0' ]; then
|
||||
echo clause $1 not plausible
|
||||
exit 1
|
||||
fi
|
||||
local num_for="$(matched "$3")"
|
||||
local num_against="$(matched "$2")"
|
||||
if [ "$num_for" -le "$(expr 2 \* "$num_against")" ]; then
|
||||
echo "Clause $1 not plausible ($num_for examples; $num_against counterexamples)"
|
||||
return 1
|
||||
else
|
||||
echo "Clause $1 is plausible ($num_for examples; $num_against counterexamples)"
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
check 1 \[^c\]ei \[^c\]ie && check 2 cie cei && echo plausible
|
||||
check 1 '(?<!c)ei' '(?<!c)ie'
|
||||
PLAUSIBLE_1=$?
|
||||
check 2 'cie' 'cei'
|
||||
PLAUSIBLE_2=$?
|
||||
if [ $PLAUSIBLE_1 -eq 0 -a $PLAUSIBLE_2 -eq 0 ]; then
|
||||
echo "Overall, the rule is plausible"
|
||||
else
|
||||
echo "Overall, the rule is not plausible"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue