Socket
Book a DemoInstallSign in
Socket

eld-custom

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eld-custom

Fast and accurate natural language detection. Detector written in Javascript. Efficient language detector, Nito-ELD, ELD.

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

forked from https://github.com/nitotm/efficient-language-detector-js

使い方

import { eld } from './src/languageDetector.js';

await eld.init("ngramsM60-subset-de-en-es-fr-it-ja-ko-pt-zh.js");
const result = eld.detect('Hello world');
console.log(result.language); // 'en'

サブセット生成

  • generateSubset.js内の以下の部分を修正して、サブセットに含めたい言語を指定。精度を高めたい場合はbaseNgramFileNameをLにする
const defaultLanguages = ["en", "ja", "zh", "es", "ko", "fr", "de", "pt", "it"];
node generateSubset.js

=> ngrams-main.jsが更新される

テスト

node test-detection.js

Keywords

nlp

FAQs

Package last updated on 14 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts