✨ A light-weight Javascript package to calculate the similarity between two Arabic words. ✨
To install this module, run:
npm install shabeh
import { isSimilar, isEqual, similarityPercentage, countMatched, countUnmatched } from 'shabeh';
console.log(isSimilar("فاطمه", "فاطمة")); // Output: true
console.log(isSimilar("داوود", "داؤود")); // Output: true
console.log(isSimilar("علي", "على")); // Output: true
console.log(isSimilar("أحمد بن داوودمحمد", "احْمد بِن دَاؤود مُحمد")); // Output: true
console.log(isEqual("فاطمه", "فاطمة")); // Output: false
console.log(isEqual("داوود", "داؤود")); // Output: false
console.log(isEqual("علي", "على")); // Output: false
console.log(isEqual("مرحباً", "مرحبا")); // Output: true
console.log(isEqual("علي بنمبارك", "علي بن مبارك")); // Output: true
const similarity = similarityPercentage("داؤود", "داوود");
console.log(similarity.toFixed(2)); // Output: 100
const matched = countMatched("محمد", "محمود");
console.log(matched); // Output: 4
const unmatched = countUnmatched("محمد", "محمود");
console.log(unmatched); // Output: 1
To run the tests, run:
npm test
This project is licensed under the MIT License - see the LICENSE file for details.