I'm trying to check intersection between two strings using Python. I defined this function:
def check(s1,s2):
word_array = set.intersection(set(s1.split(" ")), set(s2.split(" ")))
n_of_words = len(word_array)
return n_of_words
It works with some sample string, but in this specific case:
d_word = "BANGKOKThailand"
nlp_word = "Despite Concerns BANGKOK"
print(check(d_word,nlp_word))
I got 0. What am I missing?