Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make detect_language return Option<Lang> #16

Open
gengjun opened this issue Oct 11, 2023 · 1 comment
Open

make detect_language return Option<Lang> #16

gengjun opened this issue Oct 11, 2023 · 1 comment

Comments

@gengjun
Copy link

gengjun commented Oct 11, 2023

Currently, this function can only return one of 16 supported languages. what if the input text is not one of them ?

pub fn detect_language(text: &str) -> Lang;
@sagarishere
Copy link

I agree with this. It should be very clear that the language has not been detected, and English should not be default.

Let the user decide which one is the default language they want to fall back upon, we can provide them with knowledge that the language could not be detected.

Eng as a default fallback is making it difficult to use for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants