I want to delete stop words in a file. The file contains a Persian sentence, a tab and then an English word in each line. The stop words are in a separate file. The code (python 3) I wrote works but the problem is, it deletes a stop word in some lines but it doesn't delete the same stop word in some other lines. It happened almost for every stop words. I guessed maybe it is because of not normalizing the words. So I normalized the 2 files, but again there was no change in the problem. What can be the cause of this problem and how can I fix it?