Given two words I want to identify the common parts of it.
For example given the two words "technology learning TEL"
and "learning TEL approach"
I want to identify the common terms learning TEL
.
Another example, lightweight web applications
and software web applications
, common terms are web applications
My current code uses in
as follows.
for item1 in mylist_1:
for item2 in mylist_2:
if item2 in item1:
tmp_mylist1.append(item2)
break
print(tmp_mylist1)
However, it fails to identify implicit word phrases as I have mentioned above in the example.
if "technology learning TEL" in "learning TEL approach":
print("done")
else:
print("no")
Hence, is there any fastest way of identifying these implicit common consecutive terms in python?