Closed serega closed 5 years ago
I don't understand why you are reporting this. It is documented behavior: https://docs.rs/fst-levenshtein/0.2.1/fst_levenshtein/enum.Error.html
The library isn't causing the panic. Your code is by calling unwrap.
Moreover, the length of the string isn't the only variable. The edit distance also significant impacts the number of states.
Thanks for your reply. I sure saw in the documentation that the construction may return an error, but I didn't find what the supported limits are on the string length and the number of edit distance. I thought that my query seems reasonable. Thanks.
Sure. You could open an issue asking for better documentation or even to configure the limit. But in this issue you are talking about panics and it's not clear what you want.
I played with the example in documentation and found that Levenshtein does not accept long strings. Here is an example
let lev = Levenshtein::new("monomorphization", 3).unwrap();
This line causes panic
thread 'main' panicked at 'called
Result::unwrap()on an
Errvalue: TooManyStates(10000)', src/libcore/result.rs:1051:5
Any sufficiently long string results in panic.