PHPackages                             djunehor/laravel-grammar - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. djunehor/laravel-grammar

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

djunehor/laravel-grammar
========================

deduce part of speech of a word

2.0.0(6y ago)4633[1 PRs](https://github.com/djunehor/laravel-grammar/pulls)MITPHPPHP ~7.0CI failing

Since Nov 22Pushed 2y ago2 watchersCompare

[ Source](https://github.com/djunehor/laravel-grammar)[ Packagist](https://packagist.org/packages/djunehor/laravel-grammar)[ RSS](/packages/djunehor-laravel-grammar/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (7)Versions (14)Used By (0)

Laravel Grammar
===============

[](#laravel-grammar)

[![CircleCI](https://camo.githubusercontent.com/c9ffd95ce8074acd9d6695052c6231aa595ec7f0b07ceb88ca68111c991da156/68747470733a2f2f636972636c6563692e636f6d2f67682f646a756e65686f722f6c61726176656c2d6772616d6d61722e7376673f7374796c653d737667)](https://circleci.com/gh/djunehor/laravel-grammar)[![Latest Stable Version](https://camo.githubusercontent.com/ca54095c1fe7f4fa53b94be74164a9233e92677a820e4124fa13148639a14573/68747470733a2f2f706f7365722e707567782e6f72672f646a756e65686f722f6c61726176656c2d6772616d6d61722f762f737461626c65)](https://packagist.org/packages/djunehor/laravel-grammar)[![Total Downloads](https://camo.githubusercontent.com/53db46f60feb5ff8ba41e641569dc317289034f686a49b5705c3ef3465f9195e/68747470733a2f2f706f7365722e707567782e6f72672f646a756e65686f722f6c61726176656c2d6772616d6d61722f646f776e6c6f616473)](https://packagist.org/packages/djunehor/laravel-grammar)[![License](https://camo.githubusercontent.com/bcea29b6f2d2dd2b4cfdee163e3e2b8b09cfa31af159271ebd06d079b41fbd1c/68747470733a2f2f706f7365722e707567782e6f72672f646a756e65686f722f6c61726176656c2d6772616d6d61722f6c6963656e7365)](https://packagist.org/packages/djunehor/laravel-grammar)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/77a9cbb3c993488ea96f81a150b061d29737b37b1ab41e31798a76aa87bd1923/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f646a756e65686f722f6c61726176656c2d6772616d6d61722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/djunehor/laravel-grammar/?branch=master)[![Code Intelligence Status](https://camo.githubusercontent.com/72a95a9ec3a57b9c626584a5100286ac23151f5b46a35e1919a61acbad9a90d2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f646a756e65686f722f6c61726176656c2d6772616d6d61722f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/code-intelligence)[![Maintainability](https://camo.githubusercontent.com/490b2ff08c6a1cd668b57f0ab40d96c5c642bad9ba62898fd3e99a04b4918489/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f39643662653762303537313033636231343431302f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/djunehor/laravel-grammar/maintainability)[![StyleCI](https://camo.githubusercontent.com/b6343e53dbf2e14f334845bef3c300bd4c894b0cc9701c6b61e1ff390e326e90/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3232333432333434352f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/223423445)[![Code Coverage](https://camo.githubusercontent.com/31c5aabfdf97b7b85b222343dc79185e6d4b4753ebb305d7b619d5dff523483c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f646a756e65686f722f6c61726176656c2d6772616d6d61722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/djunehor/laravel-grammar/?branch=master)

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

- [Laravel Grammar](#laravel-grammar)
    - [Installation](#installation)
        - [Laravel 5.5 and above](#laravel-55-and-above)
        - [Laravel 5.4 and older](#laravel-54-and-older)
        - [Lumen](#lumen)
    - [Usage](#usage)
        - [All parts of speech](#get-all-parts-of-speech)
        - [Get part of speech](#get-word-part-of-speech)
    - [Contributing](#contributing)

Installation
------------

[](#installation)

### Step 1

[](#step-1)

You can install the package via composer:

```
composer require djunehor/laravel-grammar
```

#### Laravel 5.5 and above

[](#laravel-55-and-above)

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

#### Laravel 5.4 and older

[](#laravel-54-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

[](#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

[](#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

[](#step-3---publishing-files)

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

Usage
-----

[](#usage)

```
use Djunehor\Grammar\Word;`

$grammar = new Word();
```

### Get All Parts of Speech

[](#get-all-parts-of-speech)

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

### Get Word part of Speech

[](#get-word-part-of-speech)

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

### Check if is noun

[](#check-if-is-noun)

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

### Using Facade

[](#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
------------

[](#contributing)

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

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

12

Last Release

2361d ago

Major Versions

0.1.0 → 1.0.02019-11-22

1.0.9 → 2.0.02019-11-24

PHP version history (3 changes)0.1.0PHP ^7.0

1.0.0PHP ^7.2

1.0.2PHP ~7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/dbee0bc9066fccd4724bd58a4983602da6d74dc69f9700e94aa326b0dfa5fbf9?d=identicon)[djunehor](/maintainers/djunehor)

---

Top Contributors

[![djunehor](https://avatars.githubusercontent.com/u/20708833?v=4)](https://github.com/djunehor "djunehor (9 commits)")

---

Tags

grammarlaravellaravel-grammarlaravel-packagephplaravelgrammarenglishdjunehorpart of speech

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/djunehor-laravel-grammar/health.svg)

```
[![Health](https://phpackages.com/badges/djunehor-laravel-grammar/health.svg)](https://phpackages.com/packages/djunehor-laravel-grammar)
```

###  Alternatives

[amranidev/laracombee

Recommendation system for laravel

11636.7k1](/packages/amranidev-laracombee)[djunehor/laravel-bible

Laravel package to fetch from the Holy Bible

182.8k](/packages/djunehor-laravel-bible)[wujunze/money-wrapper

MoneyPHP Wrapper

113.8k](/packages/wujunze-money-wrapper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
