11#!/usr/bin/env python3
22import itertools
33
4- # each term is a list of lists, as some terms can be declined in more
4+ # each term is a list of lists, as some terms can be declined in more
55# than one way but still being the same (e.g ornis/ornithos)
6- pref = [ ['pullus' ], ['ornis' ,'ornithos' ], ['avis' ], ['kottos' ], ['gallus' , 'gallu' ], ['alektryon' ], ['pteron' ], ['gallina' ]]
7- mid = [ ['stercus' ],['excrementum' ],['kopros' ], ['faex' ,'faecis' ], ['merda' ],['kakke' ],['enteron' ],['intestinum' ],['' ] ]
8- terms = [ ['cola' ], ['microbium' ],['monas' ],['spira' ],['bios' ],['bacterium' ],['plasma' ],['soma' ],['' ] ]
6+ pref = [
7+ ["pullus" ],
8+ ["ornis" , "ornithos" ],
9+ ["avis" ],
10+ ["kottos" ],
11+ ["gallus" , "gallu" ],
12+ ["alektryon" ],
13+ ["pteron" ],
14+ ["gallina" ],
15+ ]
16+ mid = [
17+ ["stercus" ],
18+ ["excrementum" ],
19+ ["kopros" ],
20+ ["faex" , "faecis" ],
21+ ["merda" ],
22+ ["kakke" ],
23+ ["enteron" ],
24+ ["intestinum" ],
25+ ["" ],
26+ ]
27+ terms = [
28+ ["cola" ],
29+ ["microbium" ],
30+ ["monas" ],
31+ ["spira" ],
32+ ["bios" ],
33+ ["bacterium" ],
34+ ["plasma" ],
35+ ["soma" ],
36+ ["" ],
37+ ]
938
1039
1140# the 'iterables' list contains the parts of the word to be generated in the order they should appear
12- iterables = [ pref , mid , terms ]
41+ iterables = [pref , mid , terms ]
1342
1443counter = 0
1544
1645# itertools.product generates all the combinations of the lists in "iterables"
1746for t in itertools .product (* iterables ):
1847 spellingVariants = []
1948 for subList in t :
20- spellingVariants .append (subList )
49+ spellingVariants .append (subList )
2150 counter += 1
2251 print (counter , end = "\t " )
2352 for j in itertools .product (* spellingVariants ):
24- print ( '' .join (j ), end = ", " )
53+ print ("" .join (j ), end = ", " )
2554
2655 print ("" )
27-
0 commit comments