1.0.4 • Published 4 years ago

ar-soundex v1.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

What's New in version 1.0.4

We found that the package provide a weak performance where many words may have the same hash. To improve the performance we replaced the fixed prefix 'x' into a maped version of the first letter. Tests show a remarkable improvement in the performance and the results as well. Moreover, we treated both ة and ه at the end of the word as a ه in both cases.

arSoundex

There are many libraries that generate soundex index for English but non for Arabic. In this contribution we provide the first open source soundex index for Arabic. Our Arabic soundex library could help in improving the search in arabic documents, finding and correcting spelling errors and many other applications.

Soundex Algorithem

We developed an algorithm based on Tajweed rules that categorize the characters into groups based on it's pronunciation. The second algorithm inspired from this source

Install

npm i ar-soundex

Build

Make sure that you have installed devDependencies or run:

npm i

If you have trouble installing rollup you may check it's documentation rollup installed To build the package on your machine run the following command

npm run build

API

var arSoundex = require('ar-soundex');
arSoundex('عبدالله') // => x74600

Parameters

parameterTypeDescriptionDefult
wordStringA string of one word or more''
lengthNumberThe max length of generated index6
methodNumberTo set which algorithm to be used 1 or 21

Example

// Detecting misspelling
arSoundex('عبدالله') // => x74600
arSoundex('عبدلله') // => x74600

// Detecting extra characters

License

MIT ©

Contributions & Issues

All contributions are welcome. Create a pull request here If you have an issue please let us know . Create an issue here

Keywords

Arabic Natural Language Soundex Metaphone Index Search Spelling