Git Product home page Git Product logo

hebrew-transliteration's Introduction

hebrew-transliteration

Transliterate Unicode Hebrew text according to SBL's guidelines

install

npm

npm install --save hebrew-transliteration

local

Download or clone this repository.

cd hebrew-transliteration
npm install
npm run build

example

const heb = require("hebrew-transliteration");
const transliterate = heb.transliterate;

transliterate("אֱלֹהִים") >>> "ʾĕlōhîm";

DOCS

transliterate

heb.transliterate(text, { isSequenced: true, qametsQatan: false, isSimple: false });

Takes text <<String>> and [options] <<Object>>.

heb.transliterate("כָּל־הָעָם") >>> "kāl-hāʿām";

heb.transliterate("כָּל־הָעָם", { qametsQatan: true }) >>> "kol-hāʿām";

heb.transliterate("שָׁלֹום") >>> "šālôm";

heb.transliterate("שָׁלֹום", { isSimple: true }) >>> "shalom";

remove

heb.remove(text, { removeVowels: false });

Takes text <<String>> and [options] <<Object>>. With {removeVowels: false}, will only remove cantillation (i.e., accent) marks.

heb.remove("כָּל־הָעָם", { removeVowels: true }) >>> "כל־העם";

sequence

heb.sequence(text);

Takes text <<String>>. Returns a string of properly sequenced characters according to the SBL Hebrew Font manual.

heb.sequence("\u{5D1}\u{5B0}\u{5BC}\u{5E8}\u{5B5}\u{5D0}\u{5E9}\u{5B4}\u{5C1}\u{596}\u{5D9}\u{5EA}") >>>
  "\u{5D1}\u{5BC}\u{5B0}\u{5E8}\u{5B5}\u{5D0}\u{5E9}\u{5C1}\u{5B4}\u{596}\u{5D9}\u{5EA}";

License

MIT

Live

Use it live at charlesLoder.github.io/hebrewTransliteration

Changelong

  • v1.1.0: in transliterate() the options was changed from the misspelled isSeqeunced to isSequenced.
  • v1.2.0:
    • rewrote in in TypeScript
    • added isSimple option to transliterate() for SBL's General Purpose Style

Contributing

Please feel free to Fork, create Pull Requests, or submit issues. This is my first npm package, so any feedback is appreciated!

hebrew-transliteration's People

Contributors

charlesloder avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.