-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Milestone
Description
The find functionality is the base of the local searches and should be improved.
As of today it looks like this:
def findWrapper(inLanguageF, termInArgF):
"""
Wrapper for the `find` functionality.
Make use of the 'sentences.csv' file to to find a sentence containing
a term in an language.
"""
# findWrapper variables
with open(realPath + '/sentences.csv') as listFile:
readList = csv.reader(listFile, delimiter='\t')
def findTermInLang():
"""
function responsible for making the search AND looping the matches.
"""
foundedTerm = [
row
for row in readList
if row[1] == inLanguageF and termInArgF in row[2]
]
for row in foundedTerm:
print(row)
findTermInLang()This function, as far as I can see should iterate and return values as needed, not as huuuuge loop (sentences.csv is 6195641 lines long...).