CLD3::NNetLanguageIdentifier.new(0, 1000).find_language("User ID FA1324102A6E2C72 How to add my name on leader board?")
=> #<struct CLD3::NNetLanguageIdentifier::Result language=:ja, probability=0.7837570905685425, reliable?=true, proportion=1.0, byte_ranges=[]>
CLD3::NNetLanguageIdentifier.new(0, 1000).find_language("AAAA AA A0000000A0A0AAA AAA AA AAA AA AAAA AA AAAAAA")
=> #<struct CLD3::NNetLanguageIdentifier::Result language=:ja, probability=0.7837570905685425, reliable?=true, proportion=1.0, byte_ranges=[]>
Unfortunately, the capability of this gem is limited to what https://github.com/google/cld3 provides. You have to find an alternative if it is not satisfactory.
Same as https://github.com/google/cld3/issues/31, I have a few examples where this gem (and/or cld3) performs poorly with small texts:
Another example from v3.6.0:
How in the world that text is detected as JA 🤯