Skip to content

Some upper-case English-language texts detected as Chinese #14

@benmayersohn

Description

@benmayersohn

I noticed that when running detect on certain upper-case texts, they tend to be detected as Chinese (ZH), while applying .lower() results in correctly detecting them as English.

For example:

>>> from fast_langdetect import detect_language >>> detect_language('MY FRIEND IS A BIRD', low_memory=False) 'ZH' >>> detect_language('MY FRIEND IS A BIRD'.lower(), low_memory=False) 'EN' >>> detect_language('DANCING FOR FUN', low_memory=False) 'ZH' >>> detect_language('DANCING FOR FUN'.lower(), low_memory=False) 'EN'

For other phrases language detection works as expected, so it's not a universal issue:

>>> detect_language('HELLO THERE MY FRIEND', low_memory=False) 'EN'

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions