https://github.com/yoannchb-pro/langy
Text language detection with ISO 639-1
https://github.com/yoannchb-pro/langy
iso639-1 javascript language-detection typescript
Last synced: 3 months ago
JSON representation
Text language detection with ISO 639-1
- Host: GitHub
- URL: https://github.com/yoannchb-pro/langy
- Owner: yoannchb-pro
- License: mit
- Created: 2024-05-18T15:55:40.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-19T14:17:35.000Z (about 1 year ago)
- Last Synced: 2025-02-21T11:03:15.439Z (3 months ago)
- Topics: iso639-1, javascript, language-detection, typescript
- Language: TypeScript
- Homepage:
- Size: 8.22 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# langy
Text language detection with ISO 639-1
## Install
```
$ npm i @yoannchb/langy
```## How to use ?
```js
import { langy, langySupportedLanguages } from 'langy';console.log(langySupportedLanguages());
// [ 'fr', 'en', 'da', 'af', ... ]const result = langy(
'Hello everyone I hope you had a great day ! Dont forget to do your homework after school !'
);
console.log(result);
/*
{
best: 'en',
sortedLangs: [
'en', 'th', 'zh', 'ko', 'vi', 'bn', ...
],
probabilities: {
af: 0.01878606971307375,
sq: 0.02072365854012674,
bn: 0.03575892165723129,
zh: 0.061809341825298514,
da: 0.031837353029780316,
en: 0.14024071437431812,
...
}
}
*/
```