-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
24 lines (17 loc) · 874 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from functions import getWordsFromInputFileAndGenerateArray, removeDuplicatesAndFalsyWordsAndSort, checkFirst4Letters, checkWithOtherSeeds, checkWithOtherTurkishSeeds, createOutputFile, getFilenamesFromFolder
filesTobeTested = getFilenamesFromFolder()
print(filesTobeTested)
for index, file in enumerate(filesTobeTested):
# Read the file and generate array
arr = getWordsFromInputFileAndGenerateArray(file)
# Remove duplicates and falsy words and sort
arr = removeDuplicatesAndFalsyWordsAndSort(arr)
# Check the first 3/4 letters and remove them if they are the same
arr = checkFirst4Letters(arr)
if 'final' not in file:
# Check with other seed words
arr = checkWithOtherSeeds(arr)
arr = checkWithOtherTurkishSeeds(arr)
createOutputFile(file, arr)
print(str(index+1)+". Process for " + file + " completed.")
print('Process is completed')