PHPackages                             dennis-de-swart/php-moby-nlp - 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. dennis-de-swart/php-moby-nlp

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

dennis-de-swart/php-moby-nlp
============================

Gets the complete thought from a verb and a noun using Moby Thesaurus

1.0.0(9y ago)74.6k1MITPHPPHP &gt;=5.3

Since Jan 8Pushed 6y ago3 watchersCompare

[ Source](https://github.com/DennisDeSwart/php-moby-nlp)[ Packagist](https://packagist.org/packages/dennis-de-swart/php-moby-nlp)[ Docs](https://github.com/DennisDeSwart/PHP-Moby-NLP)[ RSS](/packages/dennis-de-swart-php-moby-nlp/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (2)Used By (0)

PHP Moby NLP
============

[](#php-moby-nlp)

[![Version](https://camo.githubusercontent.com/cb110ec7792558ece742103230ed6241f3ffe9b9e1b76b114d27c6ec9c097fc8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64656e6e69732d64652d73776172742f7068702d6d6f62792d6e6c702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dennis-de-swart/php-moby-nlp)[![Total Downloads](https://camo.githubusercontent.com/2cf5e293e2058f43e55a1a789d5a8d5f0452d8652e6ecdb1e4bf83fd4ceec209/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64656e6e69732d64652d73776172742f7068702d6d6f62792d6e6c702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dennis-de-swart/php-moby-nlp)[![Maintenance](https://camo.githubusercontent.com/103880b37e0f73f7e9171ab789edfde215270e80ef6e227871e0d210e2dd3127/68747470733a2f2f696d672e736869656c64732e696f2f6d61696e74656e616e63652f7965732f323032302e7376673f7374796c653d666c61742d737175617265)](https://github.com/DennisDeSwart/php-moby-nlp)[![Minimum PHP Version](https://camo.githubusercontent.com/5987d333982f1cbea435fe87c08cadaf483643cfc56308673f7269433272474a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e332d3441433531432e7376673f7374796c653d666c61742d737175617265)](http://php.net/)[![License](https://camo.githubusercontent.com/eb3df234c3f03e3fe0c20e17dc35c20ef46cded76a0a33257fd3457f185b7bc1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f64656e6e69732d64652d73776172742f7068702d6d6f62792d6e6c702e7376673f7374796c653d666c61742d737175617265)](https://opensource.org/licenses/MIT)

Gets the "complete thought" from a verb and a noun using Moby Thesaurus

What does it do?
----------------

[](#what-does-it-do)

- It uses the Moby Thesaurus to get the "complete thought" from a verb and a noun.
- This is meant for Natural Language Processing (NLP) tasks.

How does it work?
-----------------

[](#how-does-it-work)

- The code looks for "complete thoughts", see the link to Wikipedia here:

```
https://simple.wikipedia.org/wiki/Simple_sentence

```

- First: open the index.php, a form will appear.
- Second: enter a verb, like "walk", "talk" or "run". It is best to user the base form or lemma. So do not use "running", but use "run". This program can be used to get the lemma for you:

```
https://github.com/DennisDeSwart/php-stanford-corenlp-adapter
https://www.phpclasses.org/package/10056-PHP-Natural-language-processing-using-Stanford-server.html

```

- Third, enter a noun like "dog", "cat", "house" or "car".
- Finally, press Submit, wait for the result. The result may take up to 2 seconds.

What can I do with the result?
------------------------------

[](#what-can-i-do-with-the-result)

- First, you can use it in spam killers: if there are complete thoughts in a text, the text is probably not fake.
- Second: you can use this for creating reports and understanding text.
- Third: this could be used as suggestions in search engines.

Requirements
------------

[](#requirements)

- PHP 5.3 or higher: it also works on PHP 7

Installation using Composer
---------------------------

[](#installation-using-composer)

You can install the adapter by putting the following line into your composer.json and running a composer update

```
    {
        "require": {
            "dennis-de-swart/php-moby-nlp": "*"
        }
    }

```

Recommended practices
---------------------

[](#recommended-practices)

- Looking up words in the thesaurus can take up to 2 seconds. You should only lookup words if you need to.
- To select the most important words like verbs and nouns, you can use a NLP parser like Stanford's CoreNLP
- To use Stanford CoreNLP check these links:

```
https://github.com/DennisDeSwart/php-stanford-corenlp-adapter
http://stanfordnlp.github.io/CoreNLP/corenlp-server.html

```

Can I use a different set of words (=thesaurus)?
------------------------------------------------

[](#can-i-use-a-different-set-of-words-thesaurus)

Yes. This script uses the Moby Thesaurus that is based on the English language from 1996. It doesn't have many modern words. You can change the Thesaurus by using an API. However, this is not programmed yet. To make it happen, there needs to be an API connection. Also the existing Synonym function needs to be re-written to use this API. I want to write a script to use the Urban Dictionary API. This would make it talk "urban". Here is an example on how to connect:

```
https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation

```

Example output
--------------

[](#example-output)

See "example\_write\_document.PNG"

Any questions?
--------------

[](#any-questions)

Please let me know.

Credits
-------

[](#credits)

Brent Rossen, orginal author of the MobyThesaurus.php class

```
 https://github.com/phyous/moby-thesaurus

```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

3463d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

aicomposerlemmamoby-thesaurusnlpnounphpphp-moby-nlpthesaurusnlpnatural-languagethesaurusMobycomplete thought

### Embed Badge

![Health badge](/badges/dennis-de-swart-php-moby-nlp/health.svg)

```
[![Health](https://phpackages.com/badges/dennis-de-swart-php-moby-nlp/health.svg)](https://phpackages.com/packages/dennis-de-swart-php-moby-nlp)
```

###  Alternatives

[rubix/ml

A high-level machine learning and deep learning library for the PHP language.

2.2k1.5M28](/packages/rubix-ml)[nlp-tools/nlp-tools

NlpTools is a set of php 5.3+ classes for beginner to semi advanced natural language processing work.

775672.1k5](/packages/nlp-tools-nlp-tools)[codewithkyrian/transformers

State-of-the-art Machine Learning for PHP. Run Transformers in PHP

758267.3k9](/packages/codewithkyrian-transformers)[yooper/php-text-analysis

PHP Text Analysis is a library for performing Information Retrieval (IR) and Natural Language Processing (NLP) tasks using the PHP language

541420.5k4](/packages/yooper-php-text-analysis)[davmixcool/php-sentiment-analyzer

PHP Sentiment Analyzer is a lexicon and rule-based sentiment analysis tool that is used to understand sentiments in a sentence using VADER (Valence Aware Dictionary and sentiment Reasoner).

136173.7k1](/packages/davmixcool-php-sentiment-analyzer)[nlgen/nlgen

A library for creating recursive-descent natural language generators.

56202.6k](/packages/nlgen-nlgen)

PHPackages © 2026

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