I have a file with a long list of English verbs and I have a set of search strings; now I want to search through the verbs to find any verb which contains any of the strings as a substring. For example, the verbs "forgotten" and "negotiate" both contain the substring "got". I created a file with the set of substrings that I want to search for, then wrote a script which iterates through all the verbs and is supposed to iterate through each substring searching, but it only searches for one substring, then stops. So, it properly iterates through all of the verbs, but does not properly iterate through all of the search strings.
Example Verb File
apolog
becam
forgotten
apologis
apologis
negotiate
apologis
apologis
apologis
becom
aris
arisen
becom
arisen
Example Search String File
apol
got
aris
Here is the code I have right now, which works fine for "aris", but never looks for "got" or "apol".
import string, sys, os
import csv
myFile = open("verbs.txt","r")
data = myFile.readlines()
myFile.close()
aPol = open("apol.txt","r")
aPol_data = aPol.readlines()
aPol.close()
for line in data:
for old in aPol_data:
if old in line:
print line
Example output
>>>
aris
arisen
arisen
>>>
Any help would be appreciated.