I'm trying to find similarities between both the sentences in a shell script.
Have a two sentences containing duplicate words, for example, the input data in file my_text.txt
Shell Script.
Linux Shell Script.
The intersection of both sentences:
Shell+ScriptThe union " size " of both sentences:
3
The correct output for similarity of sentences :
0.30000000000000000000
The definition of the similarity ** is the intersection of words between the two sentences divided by the size of the union of the two sentences.
The problem: I have tried a lot to found a shell script, but I have not found a solution to this problem.