PHPackages                             mbeurel/php-lemmatizer - 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. mbeurel/php-lemmatizer

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

mbeurel/php-lemmatizer
======================

PHP Wrapper for the TreeTagger library

0.2.0(3y ago)71962[1 issues](https://github.com/mbeurel/php-lemmatizer/issues)MITPHPPHP ^7.4 | ^8.0

Since Nov 21Pushed 2y ago1 watchersCompare

[ Source](https://github.com/mbeurel/php-lemmatizer)[ Packagist](https://packagist.org/packages/mbeurel/php-lemmatizer)[ Docs](https://github.com/mbeurel/php-lemmatizer)[ RSS](/packages/mbeurel-php-lemmatizer/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)Dependencies (3)Versions (6)Used By (0)

php-lemmatizer
==============

[](#php-lemmatizer)

[![Minimum PHP Version](https://camo.githubusercontent.com/4c62148864d567c4ee794ffab09c1dd4a3f45e41064bbb016440beddaae71a4d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e322d3838393242462e737667)](https://php.net/)[![Latest Stable Version](https://camo.githubusercontent.com/1d1b0dc328580f8c104e7218c96e64a4501a18133af4a6574d2215285d37dd28/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d62657572656c2f7068702d6c656d6d6174697a65722e737667)](https://packagist.org/packages/mbeurel/php-lemmatizer)[![Total Downloads](https://camo.githubusercontent.com/8101cbeca91e30f684c23f1cc3d7844dfaa8a8946de2708d686139a0e8bba4cc/68747470733a2f2f706f7365722e707567782e6f72672f6d62657572656c2f7068702d6c656d6d6174697a65722f646f776e6c6f6164732e737667)](https://packagist.org/packages/mbeurel/php-lemmatizer)[![License](https://camo.githubusercontent.com/74743cfc834291ad3a890d5eb7208f025f148b1a03249ecaf4a93bdcde48473d/68747470733a2f2f706f7365722e707567782e6f72672f6d62657572656c2f7068702d6c656d6d6174697a65722f6c6963656e73652e737667)](https://packagist.org/packages/mbeurel/php-lemmatizer)

A simple lemmatizer tool based on [TreeTagger](https://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger/) for PHP.

Installation TreeTagger library
-------------------------------

[](#installation-treetagger-library)

View TreeTagger [WebSite](https://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger/)

Install php-lemmatizer
----------------------

[](#install-php-lemmatizer)

You can install it with Composer:

```
composer require mbeurel/php-lemmatizer

```

Examples
--------

[](#examples)

Example scripts are available ina separate repository [php-lemmatizer/example](https://github.com/mbeurel/php-lemmatizer/tree/master/exemple).

Sample Code
-----------

[](#sample-code)

```
include "vendor/autoload.php";
use PhpTreeTagger\TreeTagger;
$treeTaggerPath = __DIR__."/treeTagger"; // Library TreeTagger path

try {

  // Init library
  $treeTagger = new TreeTagger("french", array(
      "treeTaggerPath"        =>  $treeTaggerPath,      // Path to TreeTagger Library
      "debug"                 =>  false,                // View Debug
      "wordUnique"            =>  true,                 // Keep only one occurrence of the word
      "wordRemoveAccent"      =>  true,                 // Remove all accent in word
      "nbProcess"             =>  $nbProcess            // Number of processes executed at the same time
    )
  );

  // Remove type in words
  $treeTagger->setCleanTypeWords(
    array(
      "PRO:PER",
      "DET:ART",
      "DET:POS",
      "SENT",
      "PRP"
    )
  );

  // Lemmatizer String or Array parameters, to array => ["La lemmatisation désigne un traitement lexical", "apporté à un texte en vue de son analyse"]
  $result = $treeTagger->lemmatizer("La lemmatisation désigne un traitement lexical apporté à un texte en vue de son analyse.");

  // View result :
  var_dump($result);

  //  $result = array(
  //    0  =>  array(
  //      "value"     =>  "lemmatisation designer traitement lexical apporter texte vue analyse",
  //      "detail"    =>  array(
  //        1           =>  array(
  //          "source"    =>  "lemmatisation",
  //          "type"      =>  "NOM",
  //          "dest"      =>  "lemmatisation"
  //        ),
  //        2           =>  array(
  //          "source"    =>  "désigne",
  //          "type"      =>  "VER:pres",
  //          "dest"      =>  "désigner"
  //        ),
  //        4           =>  array(
  //          "source"    =>  "traitement",
  //          "type"      =>  "NOM",
  //          "dest"      =>  "traitement"
  //        ),
  //        6           =>  array(
  //          "source"    =>  "apporté",
  //          "type"      =>  "VER:pper",
  //          "dest"      =>  "apporter"
  //        ),
  //        7           =>  array(
  //          "source"    =>  "à",
  //          "type"      =>  "PRP",
  //          "dest"      =>  "à"
  //        ),
  //        9           =>  array(
  //          "source"    =>  "texte",
  //          "type"      =>  "NOM",
  //          "dest"      =>  "texte"
  //        ),
  //        10          =>  array(
  //          "source"    =>  "en",
  //          "type"      =>  "PRP",
  //          "dest"      =>  "en"
  //        ),
  //        11          =>  array(
  //          "source"    =>  "vue",
  //          "type"      =>  "NOM",
  //          "dest"      =>  "vue"
  //        ),
  //        12          =>  array(
  //          "source"    =>  "de",
  //          "type"      =>  "PRP",
  //          "dest"      =>  "de"
  //        ),
  //        13          =>  array(
  //          "source"    =>  "son",
  //          "type"      =>  "DET:POS",
  //          "dest"      =>  "son"
  //        ),
  //        14          =>  array(
  //          "source"    =>  "analyse",
  //          "type"      =>  "NOM",
  //          "dest"      =>  "analyse"
  //        ),
  //        15          =>  array(
  //          "source"    =>  ".",
  //          "type"      =>  "SENT",
  //          "dest"      =>  "."
  //        )
  //      }
  //    }
  //  }
} catch(\Exception $e) {
  echo $e;
}
```

Credits
-------

[](#credits)

Created by [Matthieu Beurel](https://www.mbeurel.com). Sponsored by [Yipikai](https://yipikai.studio).

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

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

Every ~266 days

Total

5

Last Release

1302d ago

PHP version history (2 changes)0.1.0PHP ^7.1

0.2.0PHP ^7.4 | ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/36a40743e34f6405bba0274ff4819d47c68f759927fe050976e896e56c14adbd?d=identicon)[Matthieu Beurel](/maintainers/Matthieu%20Beurel)

---

Top Contributors

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

---

Tags

phplemmatizerTreeTagger

### Embed Badge

![Health badge](/badges/mbeurel-php-lemmatizer/health.svg)

```
[![Health](https://phpackages.com/badges/mbeurel-php-lemmatizer/health.svg)](https://phpackages.com/packages/mbeurel-php-lemmatizer)
```

###  Alternatives

[jbzoo/composer-diff

See what has changed after a composer update.

53888.9k1](/packages/jbzoo-composer-diff)[zoon/rialto

Manage Node resources from PHP

12199.4k3](/packages/zoon-rialto)[arnolem/tailwindphp

TailwindPHP - use Tailwind CSS in your PHP projects (without npm)

131.1k](/packages/arnolem-tailwindphp)

PHPackages © 2026

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