Comments (3)
For anyone with similar interests: I resorted to using node-cld instead, which returns results as expected.
from franc.
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.
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)
- Improved accuracy for small documents HOT 19
- Regular Expression Denial of Service in trim HOT 1
- Make available for commonJs HOT 2
- How to generate data.js in franc packages HOT 2
- Package update for 5.0.0 HOT 1
- issue
- Link in README broken HOT 1
- Problem to detect language HOT 5
- err "The requested module does not provide an export named 'default'" HOT 1
- Not working for single words like "Hello" HOT 1
- How can I do the same thing on html? HOT 1
- BCI language code
- Franc doesnt work in TypeScript HOT 3
- Norwegian detected as Deutch HOT 3
- Make a test
- Adding a language HOT 3
- "only" parameter returns always score = 1 HOT 3
- How can I install normally? HOT 1
- npm i franc results in 1 high severity vulnerability upon install HOT 2
- the official example of `only` not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from franc.