forked from richtr/guessLanguage.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
22 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,32 +7,40 @@ A JavaScript language detection library based on trigram statistical analysis. T | |
|
||
You can clone this repo as follows: | ||
|
||
git clone [email protected]:richtr/guessLanguage.js.git | ||
```bash | ||
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> | ||
```html | ||
<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 | ||
```bash | ||
sudo npm install -g guesslanguage | ||
``` | ||
|
||
Using this library in a Node.js project can be done as follows: | ||
|
||
var guessLanguage = require('./lib/guessLanguage'); | ||
```javascript | ||
var guessLanguage = require('./lib/guessLanguage'); | ||
|
||
guessLanguage.detect('...input text here...', function(language) { | ||
console.log('Detected language of provided text is [' + language + ']'); | ||
}); | ||
guessLanguage.detect('...input text here...', function(language) { | ||
console.log('Detected language of provided text is [' + language + ']'); | ||
}); | ||
``` | ||
|
||
#### Feedback #### | ||
|
||
Please note this library is in the early stages of development. If you find any bugs or issues please file them on this project and I'll take a look. | ||
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](https://twitter.com/richtibbett/). |