0.1.1 • Published 4 years ago

pashto-phonetics-translator v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

pashto-phonetics-translator

NPM

Build Status Made with Typescript

A JavaScript library that translates Open Pashto phonetics into other forms of Pashto transliteration.

Usage

npm install --save pashto-phonetics-translator
const { 
    translatePhonetics,
    convertAfToPkSpelling,
} = require("pashto-phonetics-translator");

const translatedPhonetics = translatePhonetics("puxto", {
    system: "ipa",
    dialect: "southern",
});
console.log(translatedPhonetics);
// output: pəʂt̪o

const translatedScript = convertAfToPkSpelling("سړی");
console.log(translatedScript);
// output: سړے

API

translatePhonetics(input, [options])

Translates given phonetics (Latin transliteration) from the Open Pashto phonetics system into other phonetics systems.

options

options.system
  • "ipa"
  • "alalc"
options.dialect
  • "standard"
  • "peshawer"
  • "southern"

convertAfToPkSpelling(input: string): string

Converts Pashto text written in Afghan spelling into Pakistani spelling

Note: This is quite beta, experimental and is only recommended for small, controlled pieces of text.

Known Issue: Arabic load words ending with ی as a long a sound will get incorrectly converted to endings with ے. To avoid this be sure to write such word with the superscript Alef diacritic. eg: حتیٰ, معنیٰ, موسیٰ, etc.

convertPkToAfSpelling(input: string): string

Converts Pashto text written in Pakistani spelling into Afghan spelling

Note: This is quite beta, experimental and is only recommended for small, controlled pieces of text.

Known Issue: Arabic load words ending with ی as a long a sound will get incorrectly converted to endings with ي. To avoid this be sure to write such word with the superscript alef diacritic. eg: حتیٰ, معنیٰ, موسیٰ, etc.

standardizePashto(input: string): string

Converts Pashto text into standard spelling as used by BBC Pashto. ك's are replaced with ک's and ي's in the middle of the word are replaced with ی's, etc.

0.1.1

4 years ago

0.1.0

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

0.0.0

4 years ago