📖Additional Functions

Table of Contents

isUnit

Syntax

isUnit(word);

Description

Checks if the given word is a unit word.

Parameters

  • word (string): The input word to be checked.

Returns

  • boolean: Returns true if the word is a unit word, otherwise false.

Example

const word = "متر";
console.log(isUnit(word)); // true

getPreviousTag

Syntax

Description

Determines the grammatical case of the given word.

Parameters

  • word (string): The input word to be analyzed.

Returns

  • string: Returns the grammatical case of the word: "منصوب", "مجرور", "مرفوع", or an empty string if none of these.

Example

preTashkeelNumber

Syntax

Description

Vocalizes numbers within the given wordlist based on their grammatical case.

Parameters

  • wordlist (Array): An array of words (strings) to be processed.

Returns

  • vocalizedList (Array): An array of words with numbers vocalized according to their grammatical case.

Example

Last updated