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.
Last updated
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.
Last updated
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
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): If true
, the function returns the extracted root instead of a boolean value. Defaults to false
.
Returns
Boolean or String: If extractRoot
is false
, returns true
if the word matches the wazn and false
otherwise. If extractRoot
is true
, returns the extracted root if the word matches the wazn, and false
otherwise.
Example
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