Giter Site home page Giter Site logo

Comments (3)

tommedema avatar tommedema commented on May 11, 2024 1

For anyone with similar interests: I resorted to using node-cld instead, which returns results as expected.

from franc.

wooorm avatar wooorm commented on May 11, 2024

Interesting! There's two thing at hand here:

First, Scottish over English: That's just because the sample is short, and the chances of it being Scottish is slightly higher than English. If you pass the latin-script part on its own to franc, Scottish should also be francs primary guess. If you'd like to avoid this, either use a prebuilt version of franc with less languages, or build your own (see README).

Second, the multiple scripts: instead of testing the input against all possible languages, franc first determines the most-used script, and then only checks against languages with that script.
I don't think it's francs task to support multi-language and multi-script documents. That's a complexity I didn't account for, and should be done by another tool IMHO. You could write a tool which uses the regexes in franc (see the unicode-7.0 package) to extract different runs of text. Then, pass those through franc.

Those two problems shouldn't be related, please reopen this issue if I'm incorrect (I'm on holiday with slow Internet).

from franc.

tommedema avatar tommedema commented on May 11, 2024

Thanks.

I understand both points and certainly agree with number one not being an issue.

However, since Franc "detects language of text", and texts rarely contain only a single language, I'd argue that the probability factor returned by Franc should be influenced by all of the text given, and not just a fraction. This seems inside the scope of Franc, I. e. detecting the language of text.

If you disagree I'll look into your suggestion of running franc multiple times for different parts of my input text.

from franc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.