@pionir/detektor-js

2.0.0 • Public • Published

A short and simple script for detecting if the input text is cyrillic or latin.

It will output strings of ISO codes for the appropriate script ('Cyrl' and 'Latn' for cyrillic and latin respectively).

Just pass it a string and it will output the result.

The test folder contains a simple ava test, you can configure it differently if you wish.

For example:

import odredi from '@pionir/detektor-js'; //initializing the package  
console.log(odredi('random string of text')); //output will be Latn  
console.log(odredi('текст текст текст'))// output will be Cyrl  
console.log(odredi('text текст'))/*cyrillic text is more numerous by 1 character,  thus giving an output of Cyrl*/  

Package Sidebar

Install

npm i @pionir/detektor-js

Weekly Downloads

0

Version

2.0.0

License

GPL-3.0-only

Unpacked Size

38.1 kB

Total Files

5

Last publish

Collaborators

  • baboslav
  • marxo