๐Ÿ”คVocalization Functions

A set of functions can be used to vocalize Arabic numbers and units, which is useful when working with applications that require processing or displaying numerical data in the Arabic language.

Table of Contents

vocalizeNumber

Syntax

vocalizeNumber(wordlist, syn_tags = "")

Description

Converts a given list of Arabic words representing a number into its vocalized form. The input should be an array of strings containing Arabic words representing a number.

Parameters

  • wordlist (array) - The input array of Arabic words representing a number.

  • syn_tags (string) - Optional parameter specifying the syntactic tags associated with the input words.

Returns

  • array - An array of strings containing the vocalized form of the input words.

Example

const wordlist = ["ุซู„ุงุซุฉ", "ูˆ", "ุฃุฑุจุนูˆู†"];
const vocalized = vocalizeNumber(wordlist);
console.log(vocalized); // ["ุซูŽู„ุงุซูŒูˆู†ูŽ"]

vocalizeUnit

Syntax

vocalizeUnit(numeric, unit)

Description

Vocalizes a given Arabic unit based on its numerical value. The input should be a number and an Arabic unit.

Parameters

  • numeric (number) - The numerical value of the unit.

  • unit (string) - The Arabic unit to be vocalized.

Returns

  • string - The vocalized form of the input unit.

Example

const numeric = 2;
const unit = "ุฌู†ูŠู‡";
const vocalized = vocalizeUnit(numeric, unit);
console.log(vocalized); // "ุฌู†ูŠู‡ุงู†"

Last updated