dachev / node-cld

Language detection for Javascript (Node). Based on the CLD2 (Compact Language Detector) library from Google.
Apache License 2.0
316 stars 55 forks source link

Don't work for French language #78

Open alexandrecoulay opened 1 year ago

alexandrecoulay commented 1 year ago

Hi,

When I want to detect French language, I have this error

Error: Failed to identify language

For this code

import cld from "cld";

async function testCld() {
    const result = await cld.detect("J'aime me beurrer la biscote");
    console.log(result);
}

testCld()
vxern commented 1 year ago

I noticed cld fails to make any detection on text below +-50 characters. Give it a longer text, and it will detect the language correctly.