PHP code example of djunehor / laravel-grammar

1. Go to this page and download the library: Download djunehor/laravel-grammar 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/ */

    

djunehor / laravel-grammar example snippets


'providers' => [
    // ...
    Djunehor\Grammar\GrammarServiceProvider::class,
];

// Register Service Providers
    // ...
    $app->register(Djunehor\Grammar\GrammarServiceProvider::class);
];

use Djunehor\Grammar\Word;`

$grammar = new Word();

$partsOfSpeech = $grammar->getPartsOfSpeech();
// ['Preposition', 'Noun', 'Pronoun', 'Adverb', 'Adjective', 'Verb', 'Interjection', 'Conjunction']

$word = 'boy';
$partsOfSpeech = $grammar->getWordPartOfSpeech($word);
// ['Noun']

$word = 'boy';
$grammar = new Word($string);
$isNoun = $grammar->isNoun();
// true