PHP code example of helturkey / mosab-qafya-detector

1. Go to this page and download the library: Download helturkey/mosab-qafya-detector library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

helturkey / mosab-qafya-detector example snippets


use Mosab\QafyaDetector\QafyaDetector;

$result = QafyaDetector::make()->extract('ناداها');

$result->rawi();           // ه
$result->radf();           // ا
$result->wasl();           // ا
$result->patternSurface(); // اها

$analysis = QafyaDetector::make()->analyze([
    'قفْ بالديار وصحْ إلى بيداها',
    'فعسى الديار تجيبُ منْ ناداها',
]);

$analysis->status();             // ok|review|partial|error
$analysis->rawi();               // ه
$analysis->qafyaPattern();       // اها
$analysis->hasMultipleQafyas();  // false
$analysis->clusters();
$analysis->endings();

use Mosab\QafyaDetector\Laravel\Facades\QafyaDetector;

$result = QafyaDetector::extract('كتابُهُ');
$analysis = QafyaDetector::analyze($poem);

QafyaDetector::make()->extract(string $text, array|QafyaOptions $options = []): QafyaResult
QafyaDetector::make()->extractArray(string $text, array|QafyaOptions $options = []): array

QafyaDetector::make()->analyze(string|array $poem, array|QafyaOptions $options = []): PoemQafyaAnalysis
QafyaDetector::make()->analyzeArray(string|array $poem, array|QafyaOptions $options = []): array
bash
php artisan vendor:publish --tag=mosab-qafya-detector-config