Download the PHP package watheqalshowaiter/quran-validator without Composer

On this page you can find all versions of the php package watheqalshowaiter/quran-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package quran-validator

Quran Validator for PHP

Validate and verify Quranic verses in LLM-generated text with high accuracy for PHP 8.1+.

This project is a PHP port of the original quran-validator.

The Problem

LLMs can misquote Quranic verses—subtly changing words, missing diacritics, or combining verses incorrectly. This library provides:

  1. System prompts that instruct LLMs to tag Quran quotes in a parseable format
  2. Post-processing that validates tagged quotes against the authentic Quran database
  3. Auto-correction that fixes imprecise quotes using the authentic text
  4. Detection of untagged Arabic text that might be Quran verses

Features

Installation

Quick Start: LLM Integration

Step 1: Add the System Prompt

Step 2: Process the LLM Response

Step 3: Handle Warnings

Direct Validation API

Validate Against a Specific Reference

Verse Range Support

The processor accepts both single references and consecutive verse ranges:

Fabrication Detection

Identify words that do not occur in the Quran:

System Prompt Formats

LLM Integration Options

Supported tag formats are xml, markdown, and bracket.

Detection Methods

LlmIntegration reports how each quotation was found:

Method Description When used
tagged XML, Markdown, bracket, or inline reference Checked first
contextual Arabic after phrases such as “Allah says” or “in the Quran” After tagged quotes
fuzzy Untagged Arabic that validates as a complete Quran verse When scanUntagged is enabled

Quick Validation

Verse Lookup and Search

Arabic Text Utilities

End-to-End Processing

The package is LLM-provider agnostic. Pass the generated response through the processor before displaying or storing it:

Match Types

Type Description
exact Perfect character-by-character match
normalized Match after Arabic normalization
none No match found

Development

QuranValidator.com

quranvalidator.com is a live service built by the original author of Quran Validator, using the JavaScript version. It evaluates how well multiple LLMs handle Quran quotations—including textual accuracy and reference correctness—and publishes the results in a transparent leaderboard.

Data Source

Uses Quranic data from QUL (Quranic Universal Library) by Tarteel AI:

Total verses 6,236
Total surahs 114
Uthmani source QUL Uthmani, ayah by ayah
Simple source QUL Imlaei Simple
Encoding UTF-8

Credits

Contributing

Contributions are welcome. Run the development commands above before submitting a pull request, and include tests for changes to normalization, matching, references, or quote parsing.

License and Data

The PHP source is MIT licensed; see DATASET-LICENSE.md. Do not assume the source-code license covers the dataset.


All versions of quran-validator with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
symfony/polyfill-intl-normalizer Version ^1.38
symfony/polyfill-mbstring Version ^1.38
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package watheqalshowaiter/quran-validator contains the following files

Loading the files please wait ...