richtr / guesslanguage.js Goto Github PK
View Code? Open in Web Editor NEWA natural language detection library based on trigram statistical analysis for Node.js and the Web.
Home Page: http://richtr.github.com/guessLanguage.js/
A natural language detection library based on trigram statistical analysis for Node.js and the Web.
Home Page: http://richtr.github.com/guessLanguage.js/
In example HTML, if i remove the entire text and add something else or the same text it always return unknown... which makes me think that this plugin doesn't work at all?
It would be nice if the trigram building process was documented. For example, the German data contains strings like didiescheincheichdenin
which doesn't look like a trigram. Also, is it known what was used as input originally?
https://angular.io/guide/build#configuring-commonjs-dependencies
By the way. Have used the library before and super satisfied with it to catch spam.
Best regards,
Sam
This text, copied from http://www.gov.tw is detected as being zh.
駕駛執照替代役水質補(捐)助資訊出國疫苗地價稅牌照稅退休金技能檢定生育補助交通事故天災事變生活扶助健康檢查消費者身心障礙健康保險勞工保險教育補助
It would be nice if the detection was more specific (zh-TW).
The documentation claims to detect "zh": Chinese and "zh-TW" Chinese (Taiwan).
Burmese is listed as "Burmese"
in SINGLETONS
, but as "Myanmar"
in unicodeBlockTests
.
Fix: In unicodeBlockTests
, instead of using "Myanmar"
as the property, use "Burmese".
EDIT: Add fix.
As I asked the dev on Twitter, I just wanted to know how many characters was needed for the program to detect a language (because song titles for example don’t seem to work).
Sent with GitHawk
Where is the source text dataset for the Ngrams of those 100 languages? Would like to see if it is different from wooorm/franc#78 usage of UDHR, and if it is more accurate than them.
After install with NPM npm install guesslanguage
I have strange behaviour when importing.
Seems like the module exports a JS object so i have to duplicate and write guessLanguage.guessLanguage.detect
here an example in coffeescript
guessLanguage = require 'guesslanguage'
guessLanguage.guessLanguage.detect text, (language) ->
console.log "language is : "+language
At this line, can you correct the link to https://richtr.github.io/guessLanguage.js/
?
Because at current time, it is a 404 page.
https://github.com/richtr/guessLanguage.js/blob/master/README.md?plain=1#L8
We are discussing using guessLanguage in the Quail accessibility project here:
One issue is that of license incompatibility, since the project is MIT. We are really interested in using your existing trigram database, as there were some edge cases we have to capture with our own language-guessing project. Would you be amenable to us including the trigram database in the project, or discuss other options?
I tried this text in the demo page
aim at your goals, how many words do you want I can't understand?????
And the result is:
Detected language of provided text is Afrikaans [af].
It will be useful to have such a list at a glance.
Thank you very much for the good job :)
Norsk (Norwegian) is listed in the trigram database as "nb"
(Bokmål), but as "no"
(Both Bokmål and Nynorsk) in the guessLanguage.js file.
A fix would be to rename the property in the trigram database ("nb"
to "no"
), but that might result in incorrect results, although the difference between Bokmål and Nynorsk is not that big for the trigram. A better fix would probably be (without changing the database) to classify as "nb"
instead of "no"
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.