PHPackages                             nihongodera/limelight - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. nihongodera/limelight

ActiveProject[Parsing &amp; Serialization](/categories/parsing)

nihongodera/limelight
=====================

A php Japanese language text analyzer and parser.

v3.0.1(1y ago)10678.9k↑23.1%27[1 issues](https://github.com/nihongodera/limelight/issues)MITPHPPHP &gt;=8.0CI passing

Since Oct 29Pushed 1y ago7 watchersCompare

[ Source](https://github.com/nihongodera/limelight)[ Packagist](https://packagist.org/packages/nihongodera/limelight)[ Docs](https://github.com/nihongodera/limelight)[ RSS](/packages/nihongodera-limelight/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (40)Used By (0)

Limelight
=========

[](#limelight)

[![Latest Stable Version](https://camo.githubusercontent.com/076e9624f68e9dbb5b93d4c3bff93b0a9d9b7440ce871eb6f26e91f3dc555ced/68747470733a2f2f706f7365722e707567782e6f72672f6e69686f6e676f646572612f6c696d656c696768742f76657273696f6e2e737667)](//packagist.org/packages/nihongodera/limelight)[![License](https://camo.githubusercontent.com/e32d7b58570c1a683bfe15c6dcf2a2490f9e372f1e679648ed6c04a6c12b7b0e/68747470733a2f2f706f7365722e707567782e6f72672f6e69686f6e676f646572612f6c696d656c696768742f6c6963656e73652e737667)](//packagist.org/packages/nihongodera/limelight)

##### A php Japanese language analyzer and parser.

[](#a-php-japanese-language-analyzer-and-parser)

- Split Japanese text into individual, full words
- Find parts of speech for words
- Find dictionary entries (lemmas) for conjugated words
- Get readings and pronunciations for words
- Build furigana for words
- Convert Japanese to romaji (English lettering)

### Quick Guide

[](#quick-guide)

- [Version Notes](#version-notes)
- [Install Limelight](#install-limelight)
- [Parse Text](#parse-text)
- [Get Results](#get-results)
- [Full Documentation](#full-documentation)
- [Sources, Contributions, and Contributing](#sources-contributions-and-contributing)

### Version Notes

[](#version-notes)

- March 9, 2025: php 8 support was added.
- April 25, 2016: The Limelight API changed in Version 1.6.0. The new API uses collection methods to give developers better control of Limelight parse results. Please see the [wiki](https://github.com/nihongodera/limelight/wiki) for the updated documentation.
- April 11, 2016: php-mecab, the MeCab bindings Limelight uses, were updated to version 0.6.0 in Dec. 2015 for php 7 support. The pre-0.6.0 bindings no longer work with the master branch of Limelight. If you are using an older version of php-mecab, please update your bindings or use the [php-mecab\_pre\_0.6.0](https://github.com/nihongodera/limelight/tree/php-mecab_pre_0.6.0) version.

### Install Limelight

[](#install-limelight)

#### Using Docker

[](#using-docker)

From the project root, build the image:

```
docker build -f docker/Dockerfile -t limelight .

```

Once it is built, run the container:

```
docker run --name limelight -v /host/path/to/limelight:/usr/limelight -d --rm limelight

```

Access the project in the container:

```
docker exec -it limelight bash

```

Install composer dependencies from within the container:

```
composer install

```

To run the tests, run phpunit in the container:

```
vendor/bin/phpunit

```

#### Without Docker

[](#without-docker)

##### Requirements

[](#requirements)

- php &gt;= 8.0

##### Dependencies

[](#dependencies)

Before installing Limelight, you must install both mecab and the php extension php-mecab on your system.

###### Linux Ubuntu Users

[](#linux-ubuntu-users)

Use the install script included in this repository. The script only works for php7. Download the script:

```
curl -O https://raw.githubusercontent.com/nihongodera/limelight/master/install_mecab_php-mecab.sh

```

Make the file executable:

```
chmod +x install_mecab_php-mecab.sh

```

Execute the script:

```
./install_mecab_php-mecab.sh

```

You may need to restart your server to complete the process.

For information about what the script does, see [here](https://github.com/nihongodera/limelight/wiki/Install-Script).

###### Other Systems

[](#other-systems)

Please see [this page](https://github.com/nihongodera/php-mecab-documentation) to learn more about installing on your system.

##### Install Limelight

[](#install-limelight-1)

Install Limelight through composer.

```
composer require nihongodera/limelight

```

### Parse Text

[](#parse-text)

Make a new instance of Limelight\\Limelight. Limelight takes no arguments.

```
$limelight = new Limelight();
```

Use the parse() method on the Limelight object to parse Japanese text.

```
$results = $limelight->parse('庭でライムを育てています。');
```

The returned object is an instance of Limelight\\Classes\\LimelightResults.

### Get Results

[](#get-results)

Get results for the entire text using methods available on [LimelightResults](https://github.com/nihongodera/limelight/wiki/LimelightResults).

```
$results = $limelight->parse('庭でライムを育てています。');

echo 'Words: ' . $results->string('word') . "\n";
echo 'Readings: ' . $results->string('reading') . "\n";
echo 'Pronunciations: ' . $results->string('pronunciation') . "\n";
echo 'Lemmas: ' . $results->string('lemma') . "\n";
echo 'Parts of speech: ' . $results->string('partOfSpeech') . "\n";
echo 'Hiragana: ' . $results->toHiragana()->string('word') . "\n";
echo 'Katakana: ' . $results->toKatakana()->string('word') . "\n";
echo 'Romaji: ' . $results->string('romaji', ' ') . "\n";
echo 'Furigana: ' . $results->string('furigana') . "\n";
```

> **Output:**Words: 庭でライムを育てています。 Readings: ニワデライムヲソダテテイマス。 Pronunciations: ニワデライムヲソダテテイマス。 Lemmas: 庭でライムを育てる。 Parts of speech: noun postposition noun postposition verb symbol Hiragana: にわでらいむをそだてています。 Katakana: ニワデライムヲソダテテイマス。 Romaji: niwa de raimu o sodateteimasu. Furigana: 庭(にわ)でライムを育(そだ)てています。

Alter the collection of words however you like using the library of [collection methods](https://github.com/nihongodera/limelight/wiki/Collection-Methods).

Get individual words off the LimelightResults object by using one of several applicable [collection methods](https://github.com/nihongodera/limelight/wiki/Collection-Methods). Use methods available on the returned [LimelightWord](https://github.com/nihongodera/limelight/wiki/LimelightWord) object.

```
$results = $limelight->parse('庭でライムを育てています。');

$word1 = $results->pull(2);

$word2 = $results->where('word', '庭');

echo $word1->string('romaji') . "\n";

echo $word2->string('furigana') . "\n";
```

> **Output:**raimu 庭にわ

Methods on the LimelightResults object and the LimelightWord object follow the same conventions, but LimelightResults methods are plural (word**s**()) while LimelightWord methods are singular (word()).

Alternatively, loop through all the words on the LimelightResults object.

```
$results = $limelight->parse('庭でライムを育てています。');

foreach ($results as $word) {
    echo $word->word() . ' is a ' . $word->partOfSpeech() . ' read like ' . $word->reading() . "\n";
}
```

> **Output:**庭 is a noun read like ニワ で is a postposition read like デ ライム is a noun read like ライム を is a postposition read like ヲ 育てています is a verb read like ソダテテイマス 。 is a symbol read like 。

### Full Documentation

[](#full-documentation)

Full documentation for Limelight can be found on the [Limelight Wiki page](https://github.com/nihongodera/limelight/wiki).

### Sources, Contributions, and Contributing

[](#sources-contributions-and-contributing)

The Japanese parsing logic used in Limelight was adapted from Kimtaro's excellent Ruby program [Ve](https://github.com/Kimtaro/ve). A big thank you to him and all the others who contributed on that project.

Limelight relies heavily on both [MeCab](http://taku910.github.io/mecab/) and [php-mecab](https://github.com/rsky/php-mecab).

Collection methods and methods in the Arr class were derived from Laravel's [collection](https://github.com/illuminate/support/blob/master/Collection.php) methods.

Contributors more than welcome.

[Top](#contents)

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance44

Moderate activity, may be stable

Popularity47

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 95.4% 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 ~95 days

Recently: every ~398 days

Total

37

Last Release

435d ago

Major Versions

1.6.8 → 2.0.02025-03-02

2.0.0 → v3.0.02025-03-09

PHP version history (3 changes)v1.4.6PHP &gt;=5.6

2.0.0PHP &gt;=7.4

v3.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/00a76b63e84a85f8770b1b02b1190c03400c48528f0c33262f7789d35eca875d?d=identicon)[zachleigh](/maintainers/zachleigh)

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

---

Top Contributors

[![zachleigh](https://avatars.githubusercontent.com/u/5616626?v=4)](https://github.com/zachleigh "zachleigh (83 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (2 commits)")[![alanpoulain](https://avatars.githubusercontent.com/u/10920253?v=4)](https://github.com/alanpoulain "alanpoulain (1 commits)")[![Shou-nen](https://avatars.githubusercontent.com/u/53655415?v=4)](https://github.com/Shou-nen "Shou-nen (1 commits)")

---

Tags

japanesejapanese-languagemecabparsephp-mecablanguageparsejapanesemecabkanjifuriganaromaji

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nihongodera-limelight/health.svg)

```
[![Health](https://phpackages.com/badges/nihongodera-limelight/health.svg)](https://phpackages.com/packages/nihongodera-limelight)
```

###  Alternatives

[aranyasen/hl7

HL7 parser, generator and sender.

1951.3M](/packages/aranyasen-hl7)[olamedia/nokogiri

HTML Parser

23176.3k3](/packages/olamedia-nokogiri)[rajentrivedi/tokenizer-x

TokenizerX calculates required tokens for given prompt

91214.0k3](/packages/rajentrivedi-tokenizer-x)[adci/full-name-parser

Parses a human name

29714.4k5](/packages/adci-full-name-parser)[dimabdc/php-fast-simple-html-dom-parser

PHP Fast Simple HTML DOM parser.

9352.6k](/packages/dimabdc-php-fast-simple-html-dom-parser)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

44127.5k6](/packages/jstewmc-rtf)

PHPackages © 2026

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