Yomguithereal / mnemonist

Curated collection of data structures for the JavaScript/TypeScript language.
https://yomguithereal.github.io/mnemonist
MIT License
2.26k stars 92 forks source link

Possible bug Generalized Suffix Array - longestCommonSubsequence #209

Open ghost opened 1 year ago

ghost commented 1 year ago

To reproduce:

var GeneralizedSuffixArray = require('mnemonist/suffix-array').GeneralizedSuffixArray;

let gsa = new GeneralizedSuffixArray(["abcde", "ace"]);
let actual = gsa.longestCommonSubsequence();
let expected = "ace";
console.assert(actual == expected);

longestCommonSubsequence gives back "a" in this instance.

Yomguithereal commented 1 year ago

This is a duplicate of #196. There is indeed a bug here but I need quite a lot of time to fix it and I don't really have any incentive in the short term to do so. I will of course review a PR on the matter though.