PHPackages                             tzlion/wiktionator - 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. tzlion/wiktionator

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

tzlion/wiktionator
==================

English Wiktionary word category lookup &amp; randomisation

v0.1.0(7y ago)091MITPHPPHP &gt;=5.4

Since Sep 8Pushed 7y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (2)Used By (0)

Wiktionator
===========

[](#wiktionator)

English Wiktionary word category lookup thing. Maybe useful for some applications, I mostly used it for silly twitter bots. Can get a random word from a category and get category info for a given word.

Can operate either on the live API or a MySQL db (preliminary)

Usage
-----

[](#usage)

### From API

[](#from-api)

To use it with the **live Wiktionary API**, just instantiate `TzLion\Wiktionator\ApiWiktionator` and call whichever methods you need to.

### From database

[](#from-database)

You can also use a copy of the Wiktionary data in a MySQL database derived from one of the official DB dumps. This is much faster than calling the API if your application needs to do a lot of lookups. But it's also extremely preliminary and you'll need to provide and host your own (large) DB.

Instantiate `TzLion\Wiktionator\DbWiktionator` with an array of connection details like this:

`new TzLion\Wiktionator\DbWiktionator(['hostname', 'username', 'password', 'database_name'])`

Currently your DB will need the following tables: `category`, `categorylinks`, `page`from the [official dumps for enwiktionary](https://dumps.wikimedia.org/backup-index.html). You can also delete columns not in use to save space.

### DB with fallback

[](#db-with-fallback)

If you want to try the DB first but fall back to the API if it can't be connected, you can call `TzLion\Wiktionator\Wiktionator::getInstance` with the DB connection details as detailed above. If you call it with no connection details, you'll always get the API version.

Methods
-------

[](#methods)

These should work the same on either the API or DB versions unless otherwise specified.

- `getWordPage` **API only!** Get the full Wiktionary page for the given word.
- `isWordInCategory` Check if the given word is in the given category.
- `getWordCategories` Get all the categories the given word is in.
- `getRandomWordInCategory` Get a random word in the given category.
    Note the randomness here is much better when using a database, since the API doesn't provide this functionality natively so we have to kind of fake it.
- `wordExistsInLanguage` Check if the given word exists in the given language.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

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

2804d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/39ae7a17a6d541b80e78e9c771c9f6e33ffd64f6545eeed4de53795962d09fc7?d=identicon)[lions](/maintainers/lions)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/tzlion-wiktionator/health.svg)

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

###  Alternatives

[tareq1988/wordpress-settings-api-class

WordPress settings API Abstraction Class

46611.1k3](/packages/tareq1988-wordpress-settings-api-class)

PHPackages © 2026

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