Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Grammar Laravel Package

djunehor/laravel-grammar

View on GitHub
Deep Wiki
Context7

Laravel Grammar

CircleCI Latest Stable Version Total Downloads License Scrutinizer Code Quality Code Intelligence Status Maintainability StyleCI Code Coverage

Laravel Grammar allows you detect the part of speech of a word. It returns an array of parts of speech a word belong to.

Installation

Step 1

You can install the package via composer:

composer require djunehor/laravel-grammar

Laravel 5.5 and above

The package will automatically register itself, so you can start using it immediately.

Laravel 5.4 and older

In Laravel version 5.4 and older, you have to add the service provider in config/app.php file manually:

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

Lumen

After installing the package, you will have to register it in bootstrap/app.php file manually:

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

Step 2 - Publishing files

Run: php artisan vendor:publish --tag=laravel-grammar This will move the migration file, seeder file and config file to your app. You can change the entries table name in config/laravel-grammar.php

Step 3 - Publishing files

  • Runphp artisan migrate to create the table.
  • Run php artisan db:seed --class=LaravelGrammarSeeder to seed table

Usage

use Djunehor\Grammar\Word;`

$grammar = new Word();

Get All Parts of Speech

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

Get Word part of Speech

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

Check if is noun

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

Using Facade

In order to use the Grammar facade:

  • First add 'Grammar' => GrammarFacade::class, to aliases in config/app.php
  • Then use like \Grammar::getPartsOfSpeech();

Contributing

  • Fork this project
  • Clone to your repo
  • Make your changes and run tests composer test
  • Push and create Pull request
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope