franc-cjs
v6.2.0
Published
Natural language detection, for CommonJS.
Maintainers
Readme
Franc CJS
Natural language detection library for CommonJS.
Languages
Installation
NPM
You can install it directly through the npm command.
$ npm i franc-cjs --saveCDN
If you're using it in a browser, you can utilize the CDN mode.
<script src="https://cdn.jsdelivr.net/npm/@litert/[email protected]/dist/loader.min.js?path=index&npm={'franc-cjs':'6.1.0-patch.3'}"></script>Usage
Demo code is written using TypeScript.
import * as franc from './index';
franc.francAll('Сегодня погода такая хорошая, ты что думаешь? Я думаю, что просто так.', {
'only': ['cmn', 'rus', 'jpn']
}); // [['rus', 1]]
franc.franc('O tempo está realmente bom hoje, o que você acha? Eu acho que é isso.'); // por
franc.franc('The weather is really nice today, don\'t you think? I think it\'s just perfect.'); // eng
franc.franc('今日の天気はとてもいいですね、どう思いますか?私はこれがちょうどいいと思います。'); // jpn
franc.franc('今天的天气真好,你觉得呢?我觉得就是这样。'); // cmnTest
Node
Once it's compiled correctly, you can run the sample code in the terminal by using node ./dist/test-node.
Browser
To view the examples, simply access the test/ directory in your browser.
Click here to view the examples online
Original
This library is the CommonJS version of franc library. If you need the ESM-only version, please use the original version directly. This library will be updated in sync with franc library.
License
This library is published under MIT license.
