mirror of
https://github.com/Findus23/nonsense.git
synced 2024-09-19 16:03:50 +02:00
original version from 2015
found when cleaning up pc
This commit is contained in:
commit
d75c67f993
30 changed files with 19602 additions and 0 deletions
BIN
IKEA.pdf
Normal file
BIN
IKEA.pdf
Normal file
Binary file not shown.
40
IKEA.tex.bak
Normal file
40
IKEA.tex.bak
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
\documentclass[14pt,a4paper]{article}
|
||||||
|
\usepackage[utf8]{inputenc}
|
||||||
|
\usepackage[ngerman]{babel}
|
||||||
|
\usepackage[T1]{fontenc}
|
||||||
|
\author{Lukas Winkler}
|
||||||
|
\begin{document}
|
||||||
|
\section{Ikea-Artikel}
|
||||||
|
\begin{table}{cc}
|
||||||
|
SLUMRA & Spülschüssel belüfteter \\
|
||||||
|
MÅLA & Martiniglas mit Befestigungsseil grober \\
|
||||||
|
TÅSTRUP & 2er-Hängeleuchte \\
|
||||||
|
KLIMPEN & Hähnchenpfanne gewebt \\
|
||||||
|
SONGE & Kiste 24-tlg. mit Eckkleiderschrank \\
|
||||||
|
KULÖRT & Regal \\
|
||||||
|
ALVINE & Pfannkuchen mit Karlstad geräuchert \\
|
||||||
|
TYDLIG & Handpuppe mit Serie.. links vol. \\
|
||||||
|
HÖNSBÄR & Zwiebel \\
|
||||||
|
FÖREBILD & 2er-Set \\
|
||||||
|
MELLTORP NISSE & Knoblauchsoße der \\
|
||||||
|
DIREKT & Abflussstop veget. sitz mit Boden \\
|
||||||
|
BARMHÄRTIG & Pinnwand gewebt \\
|
||||||
|
DORTHY & Deckpl. mit Pizzastück \\
|
||||||
|
RUNDLIG & Eisportionierer wasserdicht \\
|
||||||
|
ENIGT & -Bank \\
|
||||||
|
VÄNNERNA & Schubladenelement \\
|
||||||
|
STRANDMON & Flur \\
|
||||||
|
POTATIS & Hängemattengestell mit Tieren \\
|
||||||
|
HALOGEN & Lasur \\
|
||||||
|
LERHAMN & Abfalleimer \\
|
||||||
|
OST PRÄST & Stunden 3-teilig \\
|
||||||
|
DOMSJÖ & Barhockerbezug \\
|
||||||
|
BEFINTLIG & Soßenkanne mit Abschirmung \\
|
||||||
|
LUDDHAVRE & Eckschreibtisch klein weiß \\
|
||||||
|
INDIRA & Barhockerbezug weich warm \\
|
||||||
|
POLARVIDE & Müsli mit Siphon \\
|
||||||
|
VÄSMAN & Serie \\
|
||||||
|
KORNUM & Stange \\
|
||||||
|
LEIRVIK & Förmchen mit Faltjalousie gepresst \\
|
||||||
|
\end{table}
|
||||||
|
\end{document}
|
1
README.md
Normal file
1
README.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
# nonsense
|
191
adj.txt
Normal file
191
adj.txt
Normal file
|
@ -0,0 +1,191 @@
|
||||||
|
3-spots
|
||||||
|
5-sided
|
||||||
|
5-spots
|
||||||
|
and
|
||||||
|
armrests
|
||||||
|
baby
|
||||||
|
backrest
|
||||||
|
bag
|
||||||
|
bar
|
||||||
|
base
|
||||||
|
basket
|
||||||
|
bath
|
||||||
|
bed
|
||||||
|
beeswax
|
||||||
|
bench
|
||||||
|
block
|
||||||
|
board
|
||||||
|
bowl
|
||||||
|
box
|
||||||
|
bracket
|
||||||
|
brush
|
||||||
|
cabinet
|
||||||
|
cake
|
||||||
|
candle
|
||||||
|
ceiling
|
||||||
|
ceramic
|
||||||
|
chair
|
||||||
|
chairs
|
||||||
|
chaise
|
||||||
|
chest
|
||||||
|
children
|
||||||
|
chopping
|
||||||
|
clip
|
||||||
|
clothes-basket
|
||||||
|
coat-hanger
|
||||||
|
colander
|
||||||
|
collection
|
||||||
|
combination
|
||||||
|
compartments
|
||||||
|
conference
|
||||||
|
corner
|
||||||
|
cover
|
||||||
|
cream
|
||||||
|
curtain
|
||||||
|
curtains
|
||||||
|
cushion
|
||||||
|
cutlery
|
||||||
|
decoration
|
||||||
|
desk
|
||||||
|
dish
|
||||||
|
dishwasher
|
||||||
|
divan
|
||||||
|
door
|
||||||
|
doors
|
||||||
|
double-bowl
|
||||||
|
double-sided
|
||||||
|
drain
|
||||||
|
drainer
|
||||||
|
drawer
|
||||||
|
drawers
|
||||||
|
dust
|
||||||
|
duvet
|
||||||
|
easel
|
||||||
|
extension
|
||||||
|
fabric
|
||||||
|
fittings
|
||||||
|
flask
|
||||||
|
flatwoven
|
||||||
|
floor
|
||||||
|
foam
|
||||||
|
folding
|
||||||
|
for
|
||||||
|
frame
|
||||||
|
fully
|
||||||
|
glass
|
||||||
|
glazing
|
||||||
|
handle
|
||||||
|
hanger
|
||||||
|
hanging
|
||||||
|
headboard
|
||||||
|
height
|
||||||
|
highchair
|
||||||
|
hob
|
||||||
|
hood
|
||||||
|
hook
|
||||||
|
indoor
|
||||||
|
insert
|
||||||
|
inset
|
||||||
|
int
|
||||||
|
jug
|
||||||
|
kitchen
|
||||||
|
lamp
|
||||||
|
left
|
||||||
|
lid
|
||||||
|
lint
|
||||||
|
longue
|
||||||
|
marzipan
|
||||||
|
mat
|
||||||
|
mattress
|
||||||
|
memory
|
||||||
|
mini
|
||||||
|
mirror
|
||||||
|
mount
|
||||||
|
mug
|
||||||
|
oil
|
||||||
|
outdoor
|
||||||
|
oven
|
||||||
|
pad
|
||||||
|
paint
|
||||||
|
pair
|
||||||
|
pan
|
||||||
|
parasol
|
||||||
|
pendant
|
||||||
|
pepper
|
||||||
|
picture
|
||||||
|
pillow
|
||||||
|
pillowcases
|
||||||
|
plant
|
||||||
|
plate
|
||||||
|
polish
|
||||||
|
poster
|
||||||
|
pot
|
||||||
|
potpourri
|
||||||
|
quilt
|
||||||
|
rack
|
||||||
|
reading
|
||||||
|
rectangular
|
||||||
|
refill
|
||||||
|
right
|
||||||
|
rinsing
|
||||||
|
roller
|
||||||
|
round
|
||||||
|
rug
|
||||||
|
salt
|
||||||
|
saucer
|
||||||
|
scented
|
||||||
|
screen
|
||||||
|
sealing
|
||||||
|
series
|
||||||
|
set
|
||||||
|
shakers
|
||||||
|
sheet
|
||||||
|
shelf
|
||||||
|
shoe
|
||||||
|
shower
|
||||||
|
single
|
||||||
|
single-bowl
|
||||||
|
sink
|
||||||
|
sit
|
||||||
|
sliding-hinge
|
||||||
|
sofa
|
||||||
|
sofa-bed
|
||||||
|
spice
|
||||||
|
stand
|
||||||
|
star
|
||||||
|
step
|
||||||
|
stepladder
|
||||||
|
steps
|
||||||
|
stool
|
||||||
|
storage
|
||||||
|
str
|
||||||
|
system
|
||||||
|
table
|
||||||
|
tent
|
||||||
|
three-seat
|
||||||
|
throw
|
||||||
|
tie-back
|
||||||
|
tie-backs
|
||||||
|
toilet
|
||||||
|
top
|
||||||
|
tops
|
||||||
|
towel
|
||||||
|
track
|
||||||
|
tray
|
||||||
|
treatment
|
||||||
|
trellis
|
||||||
|
trolley
|
||||||
|
two-seat
|
||||||
|
underframe
|
||||||
|
unit
|
||||||
|
use
|
||||||
|
vacuum
|
||||||
|
vase
|
||||||
|
wall
|
||||||
|
washing-up
|
||||||
|
wine
|
||||||
|
with
|
||||||
|
wood
|
||||||
|
work
|
||||||
|
worktop
|
||||||
|
wtrap
|
28
descr.sh
Executable file
28
descr.sh
Executable file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/bin/bash
|
||||||
|
rm nomen.txt
|
||||||
|
rm adj.txt
|
||||||
|
grep -E -o '(\w|\.|\-)+' descr.txt | sort | uniq > descr_words.txt
|
||||||
|
|
||||||
|
while read line; do
|
||||||
|
if [ $(echo $line | cut -c 1) == "-" ]
|
||||||
|
then
|
||||||
|
echo $line >> suf.txt
|
||||||
|
echo "Suffix"
|
||||||
|
elif [ $(echo $line | rev | cut -c 1) == "-" ]
|
||||||
|
then
|
||||||
|
echo $line >> präf.txt
|
||||||
|
echo "Präfix"
|
||||||
|
elif echo $line | grep [[:upper:]] >/dev/null
|
||||||
|
then
|
||||||
|
if echo $line | grep [[:lower:]] >/dev/null
|
||||||
|
then #Groß und Klein-> Nomen
|
||||||
|
echo $line >>nomen.txt
|
||||||
|
echo "Nomen"
|
||||||
|
fi # nur Groß -> Ikeaname -> verwerfen
|
||||||
|
elif echo $line | egrep "([[:lower:]]){3,}" >/dev/null
|
||||||
|
then # keine Großbuchstaben, aber Kleinbuchstaben -> kein Nomen
|
||||||
|
echo $line >>adj.txt
|
||||||
|
echo "kein Nomen"
|
||||||
|
#weder Großbuchstaben noch Kleinbuchstaben -> Zahl -> verwerfen
|
||||||
|
fi
|
||||||
|
done <descr_words.txt
|
4551
descr.txt.bak
Normal file
4551
descr.txt.bak
Normal file
File diff suppressed because it is too large
Load diff
48
descr_gen.sh
Executable file
48
descr_gen.sh
Executable file
|
@ -0,0 +1,48 @@
|
||||||
|
#!/bin/bash
|
||||||
|
if [ ! -z $1 ]
|
||||||
|
then
|
||||||
|
loops=$1
|
||||||
|
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)
|
||||||
|
# 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)))")
|
||||||
|
a=0
|
||||||
|
while [ $a -lt $adj_count ]
|
||||||
|
do
|
||||||
|
if [ $(shuf -i 0-4 -n 1) == "0" ]
|
||||||
|
then
|
||||||
|
adj="mit $(shuf -n 1 nomen.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
|
||||||
|
((i++))
|
||||||
|
done
|
231
descr_words.txt
Normal file
231
descr_words.txt
Normal file
|
@ -0,0 +1,231 @@
|
||||||
|
1
|
||||||
|
2
|
||||||
|
3
|
||||||
|
30
|
||||||
|
3-spots
|
||||||
|
4
|
||||||
|
5-sided
|
||||||
|
5-spots
|
||||||
|
6
|
||||||
|
7.5
|
||||||
|
a
|
||||||
|
ADDE
|
||||||
|
and
|
||||||
|
armrests
|
||||||
|
baby
|
||||||
|
BACKABRO
|
||||||
|
BACKARYD
|
||||||
|
backrest
|
||||||
|
bag
|
||||||
|
BAGGÖN
|
||||||
|
bar
|
||||||
|
base
|
||||||
|
basket
|
||||||
|
bath
|
||||||
|
bed
|
||||||
|
beeswax
|
||||||
|
bench
|
||||||
|
BERNHARD
|
||||||
|
BERTIL
|
||||||
|
BESTÅ
|
||||||
|
BJÖRKUDDEN
|
||||||
|
BJURSTA
|
||||||
|
BLEKVIDE
|
||||||
|
block
|
||||||
|
board
|
||||||
|
BÖRJE
|
||||||
|
bowl
|
||||||
|
box
|
||||||
|
bracket
|
||||||
|
brush
|
||||||
|
cabinet
|
||||||
|
cake
|
||||||
|
candle
|
||||||
|
ceiling
|
||||||
|
ceramic
|
||||||
|
chair
|
||||||
|
chairs
|
||||||
|
chaise
|
||||||
|
chest
|
||||||
|
children
|
||||||
|
chopping
|
||||||
|
clip
|
||||||
|
clothes-basket
|
||||||
|
coat-hanger
|
||||||
|
colander
|
||||||
|
collection
|
||||||
|
combination
|
||||||
|
compartments
|
||||||
|
conference
|
||||||
|
corner
|
||||||
|
cover
|
||||||
|
cream
|
||||||
|
curtain
|
||||||
|
curtains
|
||||||
|
cushion
|
||||||
|
cutlery
|
||||||
|
decoration
|
||||||
|
desk
|
||||||
|
dish
|
||||||
|
dishwasher
|
||||||
|
divan
|
||||||
|
door
|
||||||
|
doors
|
||||||
|
double-bowl
|
||||||
|
double-sided
|
||||||
|
drain
|
||||||
|
drainer
|
||||||
|
drawer
|
||||||
|
drawers
|
||||||
|
dust
|
||||||
|
duvet
|
||||||
|
easel
|
||||||
|
extension
|
||||||
|
fabric
|
||||||
|
fittings
|
||||||
|
flask
|
||||||
|
flatwoven
|
||||||
|
floor
|
||||||
|
foam
|
||||||
|
folding
|
||||||
|
for
|
||||||
|
frame
|
||||||
|
fully
|
||||||
|
glass
|
||||||
|
glazing
|
||||||
|
handle
|
||||||
|
hanger
|
||||||
|
hanging
|
||||||
|
headboard
|
||||||
|
height
|
||||||
|
HENRIKSDAL
|
||||||
|
highchair
|
||||||
|
hob
|
||||||
|
hood
|
||||||
|
hook
|
||||||
|
IDOLF
|
||||||
|
in
|
||||||
|
indoor
|
||||||
|
INGOLF
|
||||||
|
INREDA
|
||||||
|
insert
|
||||||
|
inset
|
||||||
|
int
|
||||||
|
jug
|
||||||
|
kitchen
|
||||||
|
lamp
|
||||||
|
left
|
||||||
|
lid
|
||||||
|
lint
|
||||||
|
longue
|
||||||
|
MARIEBY
|
||||||
|
marzipan
|
||||||
|
mat
|
||||||
|
MATTARP
|
||||||
|
mattress
|
||||||
|
memory
|
||||||
|
mini
|
||||||
|
mirror
|
||||||
|
mount
|
||||||
|
mug
|
||||||
|
NILS
|
||||||
|
NISSE
|
||||||
|
NORRNÄS
|
||||||
|
of
|
||||||
|
oil
|
||||||
|
OPPEBY
|
||||||
|
outdoor
|
||||||
|
oven
|
||||||
|
pad
|
||||||
|
paint
|
||||||
|
pair
|
||||||
|
pan
|
||||||
|
parasol
|
||||||
|
pendant
|
||||||
|
pepper
|
||||||
|
picture
|
||||||
|
pillow
|
||||||
|
pillowcases
|
||||||
|
plant
|
||||||
|
plate
|
||||||
|
polish
|
||||||
|
poster
|
||||||
|
pot
|
||||||
|
potpourri
|
||||||
|
PREBEN
|
||||||
|
quilt
|
||||||
|
rack
|
||||||
|
reading
|
||||||
|
rectangular
|
||||||
|
refill
|
||||||
|
right
|
||||||
|
rinsing
|
||||||
|
roller
|
||||||
|
round
|
||||||
|
rug
|
||||||
|
RYDEBÄCK
|
||||||
|
s
|
||||||
|
salt
|
||||||
|
saucer
|
||||||
|
scented
|
||||||
|
screen
|
||||||
|
sealing
|
||||||
|
series
|
||||||
|
set
|
||||||
|
shakers
|
||||||
|
sheet
|
||||||
|
shelf
|
||||||
|
shoe
|
||||||
|
shower
|
||||||
|
single
|
||||||
|
single-bowl
|
||||||
|
sink
|
||||||
|
sit
|
||||||
|
SLÄHULT
|
||||||
|
sliding-hinge
|
||||||
|
sofa
|
||||||
|
sofa-bed
|
||||||
|
spice
|
||||||
|
stand
|
||||||
|
star
|
||||||
|
step
|
||||||
|
stepladder
|
||||||
|
steps
|
||||||
|
stool
|
||||||
|
storage
|
||||||
|
str
|
||||||
|
SVARTÖ
|
||||||
|
system
|
||||||
|
table
|
||||||
|
tent
|
||||||
|
TERJE
|
||||||
|
three-seat
|
||||||
|
throw
|
||||||
|
tie-back
|
||||||
|
tie-backs
|
||||||
|
TOG
|
||||||
|
toilet
|
||||||
|
top
|
||||||
|
tops
|
||||||
|
towel
|
||||||
|
track
|
||||||
|
tray
|
||||||
|
treatment
|
||||||
|
trellis
|
||||||
|
trolley
|
||||||
|
two-seat
|
||||||
|
underframe
|
||||||
|
unit
|
||||||
|
use
|
||||||
|
vacuum
|
||||||
|
vase
|
||||||
|
VILMAR
|
||||||
|
w
|
||||||
|
wall
|
||||||
|
washing-up
|
||||||
|
wine
|
||||||
|
with
|
||||||
|
wood
|
||||||
|
work
|
||||||
|
worktop
|
||||||
|
wtrap
|
1008
english/adj.txt
Normal file
1008
english/adj.txt
Normal file
File diff suppressed because it is too large
Load diff
28
english/descr.sh
Executable file
28
english/descr.sh
Executable file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/bin/bash
|
||||||
|
rm nomen.txt
|
||||||
|
rm adj.txt
|
||||||
|
grep -E -o '(\w|\.|\-)+' descr.txt | sort | uniq > descr_words.txt
|
||||||
|
|
||||||
|
while read line; do
|
||||||
|
if [ $(echo $line | cut -c 1) == "-" ]
|
||||||
|
then
|
||||||
|
echo $line >> suf.txt
|
||||||
|
echo "Suffix"
|
||||||
|
elif [ $(echo $line | rev | cut -c 1) == "-" ]
|
||||||
|
then
|
||||||
|
echo $line >> präf.txt
|
||||||
|
echo "Präfix"
|
||||||
|
elif echo $line | grep [[:upper:]] >/dev/null
|
||||||
|
then
|
||||||
|
if echo $line | grep [[:lower:]] >/dev/null
|
||||||
|
then #Groß und Klein-> Nomen
|
||||||
|
echo $line >>nomen.txt
|
||||||
|
echo "Nomen"
|
||||||
|
fi # nur Groß -> Ikeaname -> verwerfen
|
||||||
|
elif echo $line | egrep "([[:lower:]]){3,}" >/dev/null
|
||||||
|
then # keine Großbuchstaben, aber Kleinbuchstaben -> kein Nomen
|
||||||
|
echo $line >>adj.txt
|
||||||
|
echo "kein Nomen"
|
||||||
|
#weder Großbuchstaben noch Kleinbuchstaben -> Zahl -> verwerfen
|
||||||
|
fi
|
||||||
|
done <descr_words.txt
|
1535
english/descr.txt
Normal file
1535
english/descr.txt
Normal file
File diff suppressed because it is too large
Load diff
30
english/descr_gen.sh
Executable file
30
english/descr_gen.sh
Executable file
|
@ -0,0 +1,30 @@
|
||||||
|
#!/bin/bash
|
||||||
|
if [ ! -z $1 ]
|
||||||
|
then
|
||||||
|
loops=$1
|
||||||
|
else
|
||||||
|
loops=1
|
||||||
|
fi
|
||||||
|
i=0
|
||||||
|
while [ $i -lt $loops ]
|
||||||
|
do
|
||||||
|
ikeaname=$(./ikeagen.py)
|
||||||
|
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(3.0,3.0)))")
|
||||||
|
a=0
|
||||||
|
while [ $a -lt $adj_count ]
|
||||||
|
do
|
||||||
|
if [ $(shuf -i 0-4 -n 1) == "0" ]
|
||||||
|
then
|
||||||
|
adj="with $(shuf -n 1 adj.txt)"
|
||||||
|
else
|
||||||
|
adj=$(shuf -n 1 adj.txt)
|
||||||
|
fi
|
||||||
|
text="$text $adj"
|
||||||
|
((a++))
|
||||||
|
done
|
||||||
|
echo "$ikeaname: $text"
|
||||||
|
echo "$ikeaname: $text" | festival --tts
|
||||||
|
((i++))
|
||||||
|
done
|
1229
english/descr_words.txt
Normal file
1229
english/descr_words.txt
Normal file
File diff suppressed because it is too large
Load diff
45
english/ikeagen.py
Executable file
45
english/ikeagen.py
Executable file
|
@ -0,0 +1,45 @@
|
||||||
|
#!/usr/bin/python3
|
||||||
|
import random
|
||||||
|
import sys
|
||||||
|
|
||||||
|
table= [ [ 0 for i in range(221) ] for j in range(221) ]
|
||||||
|
contents = open("ikeaname.txt").read().splitlines()
|
||||||
|
anzahl=0
|
||||||
|
for name in contents:
|
||||||
|
name= " " + name + " "
|
||||||
|
zeichen=list(name)
|
||||||
|
zeichenl=len(zeichen)
|
||||||
|
zeichenl += -1
|
||||||
|
a=0
|
||||||
|
while a < zeichenl:
|
||||||
|
table[ord(zeichen[a])][ord(zeichen[a+1])] +=1
|
||||||
|
anzahl +=1
|
||||||
|
a +=1
|
||||||
|
#row=0
|
||||||
|
#col=0
|
||||||
|
#for coln in range(221):
|
||||||
|
# for rown in range(221):
|
||||||
|
# if table[coln][rown] != 0:
|
||||||
|
# print(table[coln][rown],chr(rown),chr(coln))
|
||||||
|
#print(anzahl)
|
||||||
|
def letter(a):
|
||||||
|
mylist=[]
|
||||||
|
for b in range(221):
|
||||||
|
for x in range(table[a][b]):
|
||||||
|
mylist.append(b)
|
||||||
|
|
||||||
|
return random.choice(mylist)
|
||||||
|
try:
|
||||||
|
num=int(sys.argv[1])
|
||||||
|
except:
|
||||||
|
num=1
|
||||||
|
textnr=0
|
||||||
|
while textnr < num:
|
||||||
|
a=32
|
||||||
|
wort=[]
|
||||||
|
while a != 32 or wort == []:
|
||||||
|
a=letter(a)
|
||||||
|
wort.append(chr(a))
|
||||||
|
if len(wort) > 3:
|
||||||
|
print("".join(wort))
|
||||||
|
textnr +=1
|
2095
english/ikeaname.txt
Normal file
2095
english/ikeaname.txt
Normal file
File diff suppressed because it is too large
Load diff
22
english/liste.sh
Executable file
22
english/liste.sh
Executable file
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#for i in {0..25}
|
||||||
|
#do
|
||||||
|
# wget -O download.tmp http://www.ikea.com/at/de/catalog/productsaz/$i/
|
||||||
|
#done
|
||||||
|
rm ikeaname.txt
|
||||||
|
rm descr.txt
|
||||||
|
|
||||||
|
for i in {0..25}
|
||||||
|
do
|
||||||
|
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)' -)
|
||||||
|
ikeaname=$(echo "$name" | egrep -o "((([A-Z])+){2,} *)+")
|
||||||
|
descr=${name#$ikeaname}
|
||||||
|
echo $ikeaname >> ikeaname.txt
|
||||||
|
echo $descr >> descr.txt
|
||||||
|
done <lines.tmp
|
||||||
|
done
|
||||||
|
|
||||||
|
rm *.tmp
|
7
english/liste_pp.sh
Executable file
7
english/liste_pp.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
sort ikeaname.txt | uniq > ikeaname.txt.tmp
|
||||||
|
sort descr.txt | uniq > descr.txt.tmp
|
||||||
|
mv ikeaname.txt.tmp ikeaname.txt
|
||||||
|
mv descr.txt.tmp descr.txt
|
||||||
|
|
23
english/nomen.txt
Normal file
23
english/nomen.txt
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
April
|
||||||
|
August
|
||||||
|
Brackets
|
||||||
|
Children
|
||||||
|
Christmas
|
||||||
|
Clothes
|
||||||
|
Design
|
||||||
|
Espresso
|
||||||
|
February
|
||||||
|
Lighting
|
||||||
|
October
|
||||||
|
Own
|
||||||
|
Series
|
||||||
|
Storage
|
||||||
|
Susan
|
||||||
|
Swedish
|
||||||
|
System
|
||||||
|
Table
|
||||||
|
Textiles
|
||||||
|
Venetian
|
||||||
|
Wall
|
||||||
|
Wardrobe
|
||||||
|
Your
|
1
english/präf.txt
Normal file
1
english/präf.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
crepe-
|
1
english/suf.txt
Normal file
1
english/suf.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
-
|
77
ikeagen.py
Executable file
77
ikeagen.py
Executable file
|
@ -0,0 +1,77 @@
|
||||||
|
#!/usr/bin/python3
|
||||||
|
import random
|
||||||
|
import sys
|
||||||
|
import json
|
||||||
|
import os.path
|
||||||
|
from PIL import Image
|
||||||
|
|
||||||
|
def gen():
|
||||||
|
table= [ [ 0 for i in range(221) ] for j in range(221) ]
|
||||||
|
contents = open("ikeaname.txt").read().splitlines()
|
||||||
|
count=0
|
||||||
|
for name in contents:
|
||||||
|
name= " " + name + " "
|
||||||
|
zeichen=list(name)
|
||||||
|
zeichenl=len(zeichen)
|
||||||
|
zeichenl += -1
|
||||||
|
a=0
|
||||||
|
while a < zeichenl:
|
||||||
|
table[ord(zeichen[a])][ord(zeichen[a+1])] +=1
|
||||||
|
count +=1
|
||||||
|
a +=1
|
||||||
|
return table,count
|
||||||
|
|
||||||
|
def save(data):
|
||||||
|
with open('ikeaname.json', 'w') as outfile:
|
||||||
|
json.dump(data, outfile)
|
||||||
|
def load():
|
||||||
|
with open('ikeaname.json') as inputfile:
|
||||||
|
table = json.load(inputfile)
|
||||||
|
return table
|
||||||
|
|
||||||
|
def letter(a):
|
||||||
|
mylist=[]
|
||||||
|
for b in range(221):
|
||||||
|
for x in range(table[a][b]):
|
||||||
|
mylist.append(b)
|
||||||
|
|
||||||
|
return random.choice(mylist)
|
||||||
|
|
||||||
|
def image():
|
||||||
|
img = Image.new('RGB', (221, 221))
|
||||||
|
maximum=max(max(table))
|
||||||
|
print(maximum)
|
||||||
|
row=0
|
||||||
|
col=0
|
||||||
|
for coln in range(221):
|
||||||
|
for rown in range(221):
|
||||||
|
color= 255-int(table[coln][rown]/maximum*255)
|
||||||
|
img.putpixel((coln,rown),(color,color,color))
|
||||||
|
|
||||||
|
img =img.resize((2210,2210),)
|
||||||
|
img.save('image.png')
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
num=int(sys.argv[1])
|
||||||
|
except:
|
||||||
|
num=1
|
||||||
|
|
||||||
|
if os.path.isfile('ikeaname.json'):
|
||||||
|
table=load()
|
||||||
|
else:
|
||||||
|
table=gen()
|
||||||
|
save(table)
|
||||||
|
|
||||||
|
image()
|
||||||
|
|
||||||
|
textnr=0
|
||||||
|
while textnr < num:
|
||||||
|
a=32
|
||||||
|
wort=[]
|
||||||
|
while a != 32 or wort == []:
|
||||||
|
a=letter(a)
|
||||||
|
wort.append(chr(a))
|
||||||
|
if len(wort) > 3:
|
||||||
|
print("".join(wort))
|
||||||
|
textnr +=1
|
2168
ikeaname.txt
Normal file
2168
ikeaname.txt
Normal file
File diff suppressed because it is too large
Load diff
4551
ikeaname.txt.bak
Normal file
4551
ikeaname.txt.bak
Normal file
File diff suppressed because it is too large
Load diff
BIN
image.png
Normal file
BIN
image.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
23
liste.sh
Executable file
23
liste.sh
Executable file
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/bash
|
||||||
|
rm ikeaname.txt
|
||||||
|
rm descr.txt
|
||||||
|
|
||||||
|
for i in {0..25}
|
||||||
|
do
|
||||||
|
wget -O download.tmp http://www.ikea.com/at/de/catalog/productsaz/$i/
|
||||||
|
grep "productsAzLink" download.tmp > lines.tmp
|
||||||
|
while read line; do
|
||||||
|
name=$(echo $line | xmllint --xpath 'string(//a)' -)
|
||||||
|
ikeaname=$(echo "$name" | egrep -o "((([A-Z])+){2,} *)+")
|
||||||
|
descr=${name#$ikeaname}
|
||||||
|
echo $ikeaname >> ikeaname.txt
|
||||||
|
echo $descr >> descr.txt
|
||||||
|
done <lines.tmp
|
||||||
|
done
|
||||||
|
rm *.tmp
|
||||||
|
|
||||||
|
sort ikeaname.txt | uniq > ikeaname.txt.tmp
|
||||||
|
sort descr.txt | uniq > descr.txt.tmp
|
||||||
|
mv ikeaname.txt.tmp ikeaname.txt
|
||||||
|
mv descr.txt.tmp descr.txt
|
||||||
|
|
25
präf.txt
Normal file
25
präf.txt
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
crepe-
|
||||||
|
Arbeits-
|
||||||
|
Decken-
|
||||||
|
Einbaukühl-
|
||||||
|
Fisch-
|
||||||
|
Fütter-
|
||||||
|
Glitter-
|
||||||
|
Hut-
|
||||||
|
Kaffee-
|
||||||
|
Kerzen-
|
||||||
|
Kleider-
|
||||||
|
Kuchen-
|
||||||
|
Kühl-
|
||||||
|
Paneel-
|
||||||
|
Rock-
|
||||||
|
Salz-
|
||||||
|
Schrank-
|
||||||
|
Schreib-
|
||||||
|
sitz-
|
||||||
|
Sitz-
|
||||||
|
Spül-
|
||||||
|
Stand-
|
||||||
|
Tüten-
|
||||||
|
Wand-
|
||||||
|
crepe-
|
17
suf.txt
Normal file
17
suf.txt
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
-
|
||||||
|
-
|
||||||
|
-Bank
|
||||||
|
-Bürste
|
||||||
|
-gefrierschr.
|
||||||
|
-gefrierschrank
|
||||||
|
-halter
|
||||||
|
-Hängeleuchte
|
||||||
|
-himmel
|
||||||
|
-kästen
|
||||||
|
-Komb.
|
||||||
|
-Lampe
|
||||||
|
-Möbel
|
||||||
|
-sterne
|
||||||
|
-tuch
|
||||||
|
-Vorleger
|
||||||
|
-
|
16
tex.sh
Executable file
16
tex.sh
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
#!/bin/bash
|
||||||
|
inhalt=$(./descr_gen.sh $1 tex-export)
|
||||||
|
echo $inhalt
|
||||||
|
echo "\documentclass[14pt,a4paper]{article}
|
||||||
|
\usepackage[utf8]{inputenc}
|
||||||
|
\usepackage[ngerman]{babel}
|
||||||
|
\usepackage[T1]{fontenc}
|
||||||
|
\author{Lukas Winkler}
|
||||||
|
\begin{document}
|
||||||
|
|
||||||
|
\begin{tabular}{rl}
|
||||||
|
$inhalt
|
||||||
|
\end{tabular}
|
||||||
|
\end{document}" > IKEA.tex
|
||||||
|
pdflatex IKEA.tex
|
||||||
|
rm IKEA.tex IKEA.log IKEA.aux
|
11
vorlage.tex.bak
Normal file
11
vorlage.tex.bak
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
\documentclass[14pt,a4paper]{article}
|
||||||
|
\usepackage[utf8]{inputenc}
|
||||||
|
\usepackage[ngerman]{babel}
|
||||||
|
\usepackage[T1]{fontenc}
|
||||||
|
\author{Lukas Winkler}
|
||||||
|
\begin{document}
|
||||||
|
\chapter{Ikea-Artikel}
|
||||||
|
\begin{itemize}
|
||||||
|
XXXXX
|
||||||
|
\end{itemize}
|
||||||
|
\end{document}
|
Loading…
Reference in a new issue