Comparison Functions
A set of functions for comparing and matching Arabic words based on vocalization, patterns (wazn), and shadda positioning, designed for efficient Arabic text analysis and processing.
Table of Contents
vocalizedlike
Checks if two words are vocalized similar based on their vocalized similarity score.
Parameters
word1
(String): The first word to compare.word2
(String): The second word to compare.
Returns
Boolean:
true
if the words are vocalized similar,false
otherwise.
Example
waznlike
Checks if a given word matches a specified pattern (wazn) and optionally extracts the root.
Parameters
word1
(String): The word to be checked against the wazn.wazn
(String): The pattern to be matched.extractRoot
(Boolean, optional): Iftrue
, the function returns the extracted root instead of a boolean value. Defaults tofalse
.
Returns
Boolean or String: If
extractRoot
isfalse
, returnstrue
if the word matches the wazn andfalse
otherwise. IfextractRoot
istrue
, returns the extracted root if the word matches the wazn, andfalse
otherwise.
Example
shaddalike
Checks if two words are similar based on the position of shadda and their characters.
Parameters
partial
(String): The first word to compare.fully
(String): The second word to compare.
Returns
Boolean:
true
if the words are similar based on the position of shadda and their characters,false
otherwise.
Example
Last updated