quickwit-oss / whichlang

A blazingly fast and lightweight language detection library for Rust
MIT License
357 stars 13 forks source link

Protect detect_language against an empty string #1

Open fmassot opened 1 year ago

fmassot commented 1 year ago

currently, the function is panicking with an empty string.

evanxg852000 commented 1 year ago

I hit this while benchmarking against whatlang-rs corpora. Can we return an Option and guard against this?