Skip to content

A natural language detection library based on trigram statistical analysis for Node.js and the Web.

Notifications You must be signed in to change notification settings

toufik24/guessLanguage.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

guessLanguage.js

A JavaScript language detection library based on trigram statistical analysis. This library works equally well when run in either the Browser or Node.js.

Usage

You can clone this repo as follows:

git clone [email protected]:richtr/guessLanguage.js.git

You can use this library in a web page as follows:

<script src="lib/_languageData.js"></script>
<script src="lib/guessLanguage.js"></script>
<script>
  guessLanguage.detect('...input text here...', function(language) {
    console.log('Detected language of provided text is [' + language + ']');
  });
</script>

You can use this library in a Node.js project. This library is available as an npm package:

sudo npm install -g guesslanguage

Using this library in a Node.js project can be done as follows:

var guessLanguage = require('./lib/guessLanguage');

guessLanguage.detect('...input text here...', function(language) {
  console.log('Detected language of provided text is [' + language + ']');
});

Feedback

If you find any bugs or issues please file them on this project and I'll take a look.

Please also feel free to catch me on Twitter @richtibbett.

About

A natural language detection library based on trigram statistical analysis for Node.js and the Web.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • JavaScript 98.5%
  • HTML 1.4%
  • Makefile 0.1%