Comments (6)
Thanks for following up. I ended up using https://github.com/dachev/node-cld which has a binary dependency but the results are very accurate.
from franc.
Hey sorry about that @zeke. I don't have much time now, so I'll try to respond more extensively later.
Essentially: franc is good at many languages, which means it needs bigger input to get better results! 😞😐
from franc.
No worries! Unfortunately these short strings are all I have.
I'm really just trying to answer the question, "Is this string in English?"
Do you know of any alternatives?
I guess I could look for each word in https://github.com/zeke/an-array-of-english-words, and if most of them are found, call it English. ¯\_(ツ)_/¯
from franc.
Could you use franc.all and, when the English score is bigger than .95 (for example), call it English? Maybe that'll work?
from franc.
This is a problem inherent to the algorithm: more languages means you need bigger documents for better guessing. I’ve noted that in the readme.
You could use franc-min
, this supports less languages, making the guessing better, if you’re only dealing with top-languages.
Finally, this problem sounds more like asserting that something is English. Franc solves a slightly different problem: out of all languages, which one is the most likely? To assert that something is probably English, I suggest using franc.all
and checking of eng
has a certainty of 0.9
or higher.
from franc.
Cool project! Yeah, there‘s definitely other algorithms better at smaller input!
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.