Suppose I have a sequence:
Seq = 'hello my name'
and line:
Str = 'hello hello my friend, my awesome name is John, oh my god!'
And then I look for matches for my sequence within the string, so I get the index of the word "every word" for each word in the sequence in the cell array, so the first element is the cell containing the matches for 'hello', the second element contains the matches for 'my', and the third for 'name'.
Match = {[1 2]; %'hello' matches [3 5 11]; %'my' matches [7]} %'name' matches
I need a code to somehow get an answer saying there are possible subsequence matches:
Answer = [1 3 7; %[hello my name] 1 5 7; %[hello my name] 2 3 7; %[hello my name] 2 5 7;] %[hello my name]
Thus, the โAnswerโ contains all possible ordered sequences (why mine (word 11) never appears in the โAnswerโ, after position 11 there should be a โnameโ.
NOTE. The length and number of matches of "Seq" may vary.
matlab sequence word distance
ACenTe25 Feb 18 '14 at 23:21 2014-02-18 23:21
source share