greyblake / whatlang-rs

Natural language detection library for Rust. Try demo online: https://whatlang.org/
https://whatlang.org/
MIT License
966 stars 108 forks source link

Use full english name for Lang Enum variants #9

Closed Dr-Emann closed 7 years ago

Dr-Emann commented 7 years ago

I think it would look cleaner to use the full name for the Lang enum. e.g Lang::Mandarin vs Lang::Cmn. If wanted, we could also expose a module which rexports the short names: e.g.

use whatlang::short_lang;
let russian = short_lang::rus;
clarfonthey commented 7 years ago

I disagree; the standard language codes should be used instead.

Perhaps there could be an exposed long_name that does what you want.

greyblake commented 7 years ago

Hi! Thanks for suggestion. I guess it makes sense to use ISO codes. Why? They allow to identify a language exactly, even if it's a dialect. I know, the downside of this, it's not human readable and is not always obvious which code means which language unless you lookup the ISO table. I am planning to add a method to get a language name as a string in the future.

Thank you guys and sorry for delay.