initial commit
This commit is contained in:
16
makedict
Executable file
16
makedict
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/python3
|
||||
import sys
|
||||
|
||||
words = [ ]
|
||||
for filename in sys.argv[1:]:
|
||||
for line in open(filename):
|
||||
line = line.strip().lower()
|
||||
try:
|
||||
words[len(line)][line] = None
|
||||
except IndexError:
|
||||
while len(words) <= len(line):
|
||||
words.append({})
|
||||
for i in range(len(words)):
|
||||
words[i] = sorted(words[i].keys())
|
||||
|
||||
print('words =', words)
|
||||
Reference in New Issue
Block a user