franc-cjs
TypeScript icon, indicating that this package has built-in type declarations

6.2.0 • Public • Published

Franc CJS

License NPM stable version
GitHub releases GitHub issues

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.

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i franc-cjs

    Weekly Downloads

    163

    Version

    6.2.0

    License

    MIT

    Unpacked Size

    525 kB

    Total Files

    21

    Last publish

    Collaborators

    • hanguoshuai