Skip to main content

Fuzzy search for Quran words using phonetic or Latin transliteration

Project description

Quran Phonetic Search

Quran Phonetic Search is a Python package and CLI tool that allows fuzzy searching of Quranic words using their phonetic or simplified Latin transliterations. The package includes a preprocessed CSV dataset mapping Arabic words to their phonetic and Latin representations.

Features

  • Fuzzy search for Arabic words based on phonetic input or Latin transliteration.
  • CLI tool for quick querying.
  • Configurable result limit.
  • Reloadable database for updates.
  • Python package ready for pip installation.

Installation

You can install the package locally from source or via pip once published.

Local installation

# Build the package
python -m build

# Install locally
pip install --force-reinstall dist/quran_phonetic_search-0.1.0-py3-none-any.whl

Dependencies

  • Python 3.10 or higher
  • rapidfuzz >= 3.0, < 4.0
  • pandas >= 2.0, < 3.0

Usage

After installation, the CLI command quran-search is available.

Query a word

quran-search query <word> [--limit N]
  • <word>: Phonetic or simple Latin representation of the Quranic word.
  • --limit N: Optional. Maximum number of results to return. Defaults to 3.

Example:

quran-search query besm --limit 3

Output:

Top 3 match(es) for 'besm':
1. بِسْمِ
2. فَتَبَسَّمَ
3. بِسَمْعِهِمْ

Reload the database

quran-search reload

Reloads the CSV dataset into memory in case of updates.

Python API

You can also use the package programmatically:

from quran_phonetic_search.search import QuranSearch

searcher = QuranSearch()
results = searcher.query_word("besm", limit=3)
print(results)

Project Structure

QuranPhoneticSearch/
├── quran_phonetic_search/      # Python package
│   ├── __init__.py
│   ├── search.py
│   ├── main.py
│   └── data/
│       └── quran_words.csv
├── data_preprocessing/         # Scripts and notebooks for data cleaning and preprocessing
│   └── preprocessing.ipynb     # Shows how the dataset was collected and processed
├── README.md
├── pyproject.toml

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quran_phonetic_search-0.1.0.tar.gz (754.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quran_phonetic_search-0.1.0-py3-none-any.whl (752.8 kB view details)

Uploaded Python 3

File details

Details for the file quran_phonetic_search-0.1.0.tar.gz.

File metadata

  • Download URL: quran_phonetic_search-0.1.0.tar.gz
  • Upload date:
  • Size: 754.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for quran_phonetic_search-0.1.0.tar.gz
Algorithm Hash digest
SHA256 60a3c9bce1546ae7fcae4643cfa556ffd42e5f18eccebe89277e25b8ae4b7d7d
MD5 beb4c7b0d7a33c0eba56599e065523ba
BLAKE2b-256 f24d7133b5fd789a6ba522a2df0a0da85c9d79ac02a96ea6598b3818a347bf91

See more details on using hashes here.

File details

Details for the file quran_phonetic_search-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for quran_phonetic_search-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2c5508f5965288a9ece4ab1e9b5a6a92065ac0b395f9eee4afc71dc864aaf363
MD5 0ae0fad218353fae048748c65e146e0a
BLAKE2b-256 bff4f0c3b154571ed538004fda0d60de2ff3edb935c125d99cad967453880c46

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page