I would like to find information in one column based on the other column. So I have some words in one column and complete sentences in another. I would like to know whether it finds the words in those sentences. But sometimes the words are not the same so I cannot use the SQL like
function. Thus I think fuzzy matching + some sort of 'like' function would be helpful as the data looks like this:
Names Sentences
Airplanes Sarl Airplanes-Sàrl is part of Airplanes-Group Sarl.
Kidco Ltd. 100% ownership of Kidco.Ltd. is the mother company.
Popsi Co. Cola Inc. is 50% share of PopsiCo which is part of LaLo.
The data has about 2,000 rows which need a logic to find whether Airplanes Sarl is indeed in the sentence or not, and it also goes for Kidco Ltd. which is in the sentence as 'Kidco.Ltd'.
To simplify matters, I do not need it to search for ALL sentences in the column, it only needs to look for the word Kidco Ltd. and search for it in the same row of the dataframe.
I have already tried it in Python with: df.apply(lambda s: fuzz.ratio(s['Names'], s['Sentences']), axis=1)
But I got a lot of unicode /ascii errors so I gave up and would like to try in R. Any suggestions on how to go about this in R? I have seen answers on Stackoverflow that would fuzzy match all sentences in the column, which is different from what I want. Any suggestions?