All Projects → vbarzokas → greek-utils

vbarzokas / greek-utils

Licence: MIT License
A JavaScript library for Greek language with utilities such as replacement of accented and other diacritics characters, conversion from Greek to phonetic, transliterated or greeklish Latin and more.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to greek-utils

Util
A collection of useful utility functions
Stars: ✭ 201 (+204.55%)
Mutual labels:  utilities, string-manipulation
Utils
A collection of useful PHP functions, mini classes and snippets that you need and can use every day.
Stars: ✭ 750 (+1036.36%)
Mutual labels:  utilities, string-manipulation
awesome-networking
A curated inexhaustive list of network utilities
Stars: ✭ 36 (-45.45%)
Mutual labels:  utilities
plex
Oracle PL/SQL Export Utilities: Export Oracle APEX app, ORDS modules, all schema objects and table data in one go
Stars: ✭ 23 (-65.15%)
Mutual labels:  utilities
devbricksx-android
DevBricksX provides plenty of useful classes that will be used in daily Android development.
Stars: ✭ 22 (-66.67%)
Mutual labels:  utilities
purescript-ffi-utils
A utility library for the purescript foreign function interface
Stars: ✭ 22 (-66.67%)
Mutual labels:  utilities
RayCarrot.RCP.Metro
Rayman Control Panel (4.0.0 and above)
Stars: ✭ 24 (-63.64%)
Mutual labels:  utilities
antiutils
TypeScript/JavaScript utilities for those who don't like utilities
Stars: ✭ 31 (-53.03%)
Mutual labels:  utilities
dynamic-utils
Utility functions to perform dynamic operations on Android.
Stars: ✭ 86 (+30.3%)
Mutual labels:  utilities
iwfp
A utility (Android/iOS/web) app to help maximize your credit card cashback rewards with math and magic. May the five percent be with you ;)
Stars: ✭ 24 (-63.64%)
Mutual labels:  utilities
go
Monorepo for small Go modules maintained by Tawesoft
Stars: ✭ 16 (-75.76%)
Mutual labels:  utilities
productivity-tips-for-mac
Awesome Productivity Tips for Mac Developers
Stars: ✭ 38 (-42.42%)
Mutual labels:  utilities
dftools
Tools for Star Wars: Dark Forces assets.
Stars: ✭ 18 (-72.73%)
Mutual labels:  utilities
opentracing-utils
Convenient utilities for adding OpenTracing support in your python projects
Stars: ✭ 20 (-69.7%)
Mutual labels:  utilities
reactools
Create React interfaces is easy.
Stars: ✭ 14 (-78.79%)
Mutual labels:  utilities
string-replace-to-array
Like Javascript's string.replace, but accepts and returns an array
Stars: ✭ 19 (-71.21%)
Mutual labels:  string-manipulation
lfrgs-frontend-samples
🐰 Some useful kick-starter files and tips to improve GS Frontend Development and Liferay content configuration.
Stars: ✭ 32 (-51.52%)
Mutual labels:  utilities
mogo
A collection of small DRY Go utilities to make life easier. DRY = Don't Repeat Yourself.
Stars: ✭ 19 (-71.21%)
Mutual labels:  utilities
quick-add-github-issue-browser-extension
Quickly add GitHub issues direct from a browser button
Stars: ✭ 14 (-78.79%)
Mutual labels:  utilities
memer-action
A GitHub Action for Programmer Memes xD
Stars: ✭ 21 (-68.18%)
Mutual labels:  utilities

Greek Utilities

Build Status

A JavaScript library for Greek language with utilities such as replacement of accented and other diacritics characters, conversion from Greek to phonetic, transliterated or greeklish Latin and more, like Greek stopwords removal.

NPM

Installation

npm install --save greek-utils

Usage

Node.js

var greekUtils = require('greek-utils');

- sanitizeDiacritics(text, [ignoreCharacters])

Convert all diacritics symbols to their simple equivalent

Example 1 (modern Greek):

var sanitized = greekUtils.sanitizeDiacritics('Αρνάκι άσπρο και παχύ');
console.log(sanitized); //Αρνακι ασπρο και παχυ

Example 2 (ancient Greek):

var sanitized = greekUtils.sanitizeDiacritics('Ἐξ οὗ καὶ δῆλον ὅτι οὐδεμία τῶν ἠθικῶν ἀρετῶν φύσει ἡμῖν ἐγγίνεται');
console.log(sanitized); //Εξ ου και δηλον οτι ουδεμια των ηθικων αρετων φυσει ημιν εγγινεται

- toGreek(text, [ignoreCharacters])

Convert a Latin character text to its modern Greek equivalent

Example:

var greek = greekUtils.toGreek('kalhmera, pws eiste?');
console.log(greek); //καλημερα, πως ειστε;

- toGreeklish(text, [ignoreCharacters])

Convert a modern Greek character text to its greeklish equivalent

Example:

var greeklish = greekUtils.toGreeklish('Εύηχο: αυτό που ακούγεται ωραία.');
console.log(greeklish); //Euhxo: auto pou akougetai wraia.

- toPhoneticLatin(text, [ignoreCharacters])

Convert a modern Greek character text to its phonetically equivalent Latin (sound mapping).

Example:

var phoneticLatin = greekUtils.toPhoneticLatin('Εύηχο: αυτό που ακούγεται ωραία.');
console.log(phoneticLatin); //Évikho: aftó pou akoúyete oréa.

- toTransliteratedLatin(text, [ignoreCharacters])

Convert a modern Greek character text to its transliterated equivalent Latin (letter mapping).

Example:

var transliteratedLatin = greekUtils.toTransliteratedLatin('Εύηχο: αυτό που ακούγεται ωραία.');
console.log(transliteratedLatin); //Eúēkho: autó pou akoúgetai ōraía.
Ignoring characters

All of the above functions accept an optional second parameter as a string with characters you don't wish to be converted.

Example:

var greeklish = greekUtils.toGreeklish('καλημερα, πως ειστε;', 'ε');
console.log(greeklish); //kalhmεra, pws εistε?

- removeStopWords(text, [shouldRemoveMultipleWhiteSpaces])

Remove all stop words from the given text, for both ancient and modern Greek. Also accepts an optional flag, which when set to true will remove the multiple whitespaces that probably have occurred in the text after removing the stop words.

Note: The default value for that flag is false, so multiple whitespaces are expected to be returned.

Examples:

  • Without stripping the extra white spaces:

    var withPreservedWhitespace = greekUtils.removeStopWords('Αυτή είναι μια απλή πρόταση, που δείχνει την αφαίρεση όλων των stopwords της αρχαίας και νέας Ελληνικής γλώσσας και επιστρέφει το καθαρό κείμενο.', false);
    
    console.log(withPreservedWhitespace); //μια απλή πρόταση,  δείχνει  αφαίρεση όλων  stopwords  αρχαίας  νέας Ελληνικής γλώσσας  επιστρέφει  καθαρό κείμενο.
  • With stripping the extra white spaces:

    var withoutPreservedWhitespace = greekUtils.removeStopWords('Αυτή είναι μια απλή πρόταση, που δείχνει την αφαίρεση όλων των stopwords της αρχαίας και νέας Ελληνικής γλώσσας και επιστρέφει το καθαρό κείμενο.', true);
    
    console.log(withoutPreservedWhitespace); //μια απλή πρόταση, δείχνει αφαίρεση όλων stopwords αρχαίας νέας Ελληνικής γλώσσας επιστρέφει καθαρό κείμενο.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].