I would like to count how many times a list of words (file1) appears in another list of words (file2)
with open("corpus.txt", "r") as f1, open("lexico.txt", "r") as f2:
file1 = f1.read()
file2 = f2.read()
corpus1 = file1.split(" ")
for word in file2:
print(word, corpus1.count(word))
Corpus.txt file (file2)
I am afraid to look for other options because of the quality of light is very recommendable light very white, but the duration of everything opposite I lasted less than months the two lamps and that I put them in the assist lamp. The light I want is paler but strong enough to illuminate the room.
File lexico.txt (file1)
is
but
light
Result
is 2
0
m 0
a 2
s 0
0
l 0
u 0
z 0
0