Skip to content

Bibelstellensuche Statistiken

Mario Trojan edited this page Nov 29, 2022 · 1 revision

Anzahl von Sucherergebnissen für jedes Bibelbuch

cd /var/lib/tuelib/bibleRef

tmpFile=$(mktemp)
codeFile=$(mktemp)
nameFile=$(mktemp)

# Get all book names
cat books_of_the_bible_to_code.map | awk -F"=" '{printf $ 1"\n"}' > $nameFile

# For each book name: generate the bible ranges
for i in $(cat $nameFile); do 
    printf '{\!bibleRangeParser}' | sed 's/\\!/!/g'; 
    bib_ref_to_codes_tool $i books_of_the_bible_to_code.map books_of_the_bible_to_canonical_form. map pericopes_to_codes.map ; 
done > $codeFile

# For each bible range: perform a search and get the number of results 
for i in $(cat $codeFile); do 
    wget -q -O- "ptah.ub.uni-tuebingen.de:8080/solr/biblio/select?q=$i&wt=xml&indent=true" | grep numFound | awk -F'"' '{printf $4 "\n"}'; 
done > $tmpFile

# Concatenate the book names and the number of results, ordered by book name
paste -d"\t" $nameFile $tmpFile | sort | awk '{ print $2 " " $1}' | sed 's/ /\t/g' > results
rm $tmpFile $nameFile $codeFile
cat results