New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pravopis

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pravopis

Set of helper string manipulation functions for handling Serbian language orthography rules correctly

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-75%
Maintainers
1
Weekly downloads
 
Created
Source

pravopis

pravopis is a Node.js module which implements a few string manipulation functions which are useful when working with text in Serbian language as they handle Serbian language orthography rules correctly.

Goal of this project is to implement functions covering all Serbian language orthography rules. For now just the most basic ones are implemented.

Installation

You can get latest version of pravopis by cloning this repository or by installing the module via Yarn:

  yarn add pravopis

Or, if you are still stuck with NPM, via:

  npm install --save pravopis

Usage

const pravopis = require('pravopis');

console.log(pravopis.toCyrillic('Pozdrav!')); // => Поздрав!

Usage in browser:

Use a module bundler like Webpack or Browserify which can bundle Node modules easily.

API

pravopis.toCyrillic(s)

Transliterates string s from Serbian Latin to Serbian Cyrillic alphabet honoring orthography rules for transliterating nj/lj/ to њ/љ/џ.

Examples:

pravopis.toCyrillic('pravopis'); // правопис
pravopis.toCyrillic('injekcija, njiva'); // инјекција, њива
pravopis.toCyrillic('patlidžan, nadživeti'); // патлиџан, надживети

pravopis.toLatin(s)

Transliterates string s from Serbian Cyrillic to Serbian Latin alphabet.

Examples:

pravopis.toCyrillic('pravopis'); // правопис
pravopis.toCyrillic('injekcija, njiva'); // инјекција, њива
pravopis.toCyrillic('patlidžan, nadživeti'); // патлиџан, надживети

pravopis.toVocative(name)

Returns vocative form of string name (which is nominative form of a person's given name). Preserves casing and alphabet of a given string.

Examples:

pravopis.toVocative('Ђура'); // Ђуро
pravopis.toVocative('ПЕТАР'); // ПЕТРЕ
pravopis.toVocative('milojica'); // milojice
pravopis.toVocative('Stanoje'); // Stanoje

pravopis.equals(a, b)

Compares strings a and b and returns true if they are equal, ignoring difference in used alphabet.

Examples:

pravopis.equals('latinica', 'латиница'); // true
pravopis.equals('ćirilica', 'ћирилица'); // true
pravopis.equals('ćirilica', 'Ћирилица'); // false

pravopis.equalsIgnoreCase(a, b)

Compares strings a and b and returns true if they are equal, ignoring difference in case and used alphabet.

Examples:

pravopis.equalsIgnoreCase('latinica', 'латиница'); // true
pravopis.equalsIgnoreCase('ćirilica', 'ћирилица'); // true
pravopis.equalsIgnoreCase('ćirilica', 'Ћирилица'); // true

pravopis.hasCyrillic(s)

Returns true if string s has at least one Serbian Cyrillic letter.

Examples:

pravopis.hasCyrillic('ћирилица'); // true
pravopis.hasCyrillic('ćirilica'); // false

pravopis.hasLatin(s)

Returns true if string s has at least one Serbian Latin letter.

Examples:

pravopis.hasLatin('ћирилица'); // false
pravopis.hasLatin('ćirilica'); // true

Is it any good?

Yes.

Credits

Licence

MIT

FAQs

Package last updated on 09 May 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc