The character '水' and many other characters are both valid Chinese and Japanese, however, when inputting these cognates with a whitelist, the whitelist is ignored
use whatlang::{Lang, detect_with_options};
fn main() {
let opts = whatlang::Options::new()
.set_whitelist(vec![Lang::Jpn].to_owned());
let info = detect_with_options("水", &opts).unwrap();
println!("Lang: {}", info.lang());
}
Output: Lang: 官话 despite only Japanese being in the whitelist
The character '水' and many other characters are both valid Chinese and Japanese, however, when inputting these cognates with a whitelist, the whitelist is ignored
Output:
Lang: 官话
despite only Japanese being in the whitelist