6.2.0 • Published 2 months ago

franc-cjs v6.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 months ago

Franc CJS

Natural language detection library for CommonJS.

Languages

简体中文 | 繁體中文 | 日本語

Installation

NPM

You can install it directly through the npm command.

$ npm i franc-cjs --save

CDN

If you're using it in a browser, you can utilize the CDN mode.

<script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.5.1/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('今天的天气真好,你觉得呢?我觉得就是这样。');  // cmn

Test

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.

6.2.0

2 months ago

6.1.0-patch.3

12 months ago

6.1.0-patch.2

12 months ago

6.1.0

12 months ago