Hi @hanwencheng ,
Let's say I have 2 strings to compare:
Thomas is playing football
Thomas is playing futsal
Your library will return Thomas is playing f, which is logic in a way of substrings. But is there a way to consider words to not break them and return Thomas is playing (with space) or Thomas is playing f (with no space)?
Thank you,
EDIT: or if you have a suggestion of another library?
EDIT2: ended using the following:
const words1 = title1.split(' ');
const words2 = title2.split(' ');
let commonSubstring = '';
for (let i = 0; i < words1.length; i++) {
for (let j = 0; j < words2.length; j++) {
let tempSubstring = '';
let x = i;
let y = j;
while (x < words1.length && y < words2.length && words1[x] === words2[y]) {
tempSubstring += words1[x] + ' ';
x++;
y++;
}
if (tempSubstring.split(' ').length > commonSubstring.split(' ').length) {
commonSubstring = tempSubstring;
}
}
}
Hi @hanwencheng ,
Let's say I have 2 strings to compare:
Thomas is playing footballThomas is playing futsalYour library will return
Thomas is playing f, which is logic in a way of substrings. But is there a way to consider words to not break them and returnThomas is playing(with space) orThomas is playing f(with no space)?Thank you,
EDIT: or if you have a suggestion of another library?
EDIT2: ended using the following: