diff --git a/descr_gen.sh b/descr_gen.sh index 9c39f06..428751a 100755 --- a/descr_gen.sh +++ b/descr_gen.sh @@ -6,43 +6,25 @@ else loops=1 fi i=0 -function nomen { - if [ $(shuf -i 0-10 -n 1) == "1" ] - then - praf=$(shuf -n 1 präf.txt) - echo "$praf$(nomen)" - elif [ $(shuf -i 0-10 -n 1) == "2" ] - then - suf=$(shuf -n 1 suf.txt) - echo "$(nomen)$suf" - else - echo $(shuf -n 1 nomen.txt) - fi -} while [ $i -lt $loops ] do ikeaname=$(./ikeagen.py) - text=$(nomen) + text=$(shuf -n 1 adj.txt) # adj_count=$(shuf -i 0-2 -n 1) - adj_count=$(python -c "import random;print '{:1.0f}'.format(round(random.gauss(1.0,1.0)))") + adj_count=$(python -c "import random;print '{:1.0f}'.format(round(random.gauss(3.0,3.0)))") a=0 while [ $a -lt $adj_count ] do if [ $(shuf -i 0-4 -n 1) == "0" ] then - adj="mit $(shuf -n 1 nomen.txt)" + adj="with $(shuf -n 1 adj.txt)" else adj=$(shuf -n 1 adj.txt) fi text="$text $adj" ((a++)) done - if [ ! -z $2 ] && [ $2 == "tex-export" ] - then - echo "$ikeaname & $text \\\\" - else - echo -e "$ikeaname:\t$text" -# espeak -vde+m2 "$ikeaname: $text" - fi + echo "$ikeaname: $text" + echo "$ikeaname: $text" | festival --tts ((i++)) done diff --git a/ikeagen.py b/ikeagen.py index 5d42706..15fe31a 100755 --- a/ikeagen.py +++ b/ikeagen.py @@ -2,7 +2,7 @@ import random import sys -table= [ [ 0 for i in range(2210) ] for j in range(2210) ] +table= [ [ 0 for i in range(221) ] for j in range(221) ] contents = open("ikeaname.txt").read().splitlines() anzahl=0 for name in contents: diff --git a/liste.sh b/liste.sh index fc09365..a8d3a63 100755 --- a/liste.sh +++ b/liste.sh @@ -4,7 +4,7 @@ rm descr.txt for i in {0..25} do - wget -O download.tmp http://www.ikea.com/at/de/catalog/productsaz/$i/ + wget -O download.tmp http://www.ikea.com/gb/en/catalog/productsaz/$i/ grep "productsAzLink" download.tmp > lines.tmp while read line; do name=$(echo $line | xmllint --xpath 'string(//a)' -)