PHPackages                             cal7/trie - 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. cal7/trie

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

cal7/trie
=========

A package to facilitate usage of the TRIE data structure

17PHP

Since Jan 31Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Cal7/php-trie)[ Packagist](https://packagist.org/packages/cal7/trie)[ RSS](/packages/cal7-trie/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

php-trie
========

[](#php-trie)

A PHP package to facilitate usage of the trie data structure.

Allows the insertion and lookup of words, generation from a text file, and a search feature for Scrabble-like games

Word insertion
--------------

[](#word-insertion)

Word insertion is as easy as:

```
$trie = new Trie();
$trie->addWord("example");
```

Or if you have a text file containing a list of words (each on a newline), either locally or online, you can use:

```
$trie1 = Trie::fromTextFile("/local/path/to/file.txt");
$trie2 = Trie::fromTextFile("https://example.com/file.txt");
```

Word finding
------------

[](#word-finding)

This package offers a feature useful for many Scrabble-related applications - word finding. The following snippet showcases this:

```
$trie = new Trie();
$trie->addWords([
  "example",
  "test",
  "tested",
  "testing"
]);
$letters = ["t", "e", "s", "t"];
$wildcardCount = 2; //represents a "blank" tile in the game of Scrabble
$trie->findWords($letters, $wildcardCount); //returns ["test", "tested"]
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/cal7-trie/health.svg)

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

###  Alternatives

[muqsit/simple-packet-handler

Handle specific data packets (virion for PMMP API 4.0.0)

426.1k3](/packages/muqsit-simple-packet-handler)[webdevstudios/taxonomy_core

A tool to make custom taxonomy registration just a bit simpler. Automatically registers taxonomy labels, and provides helpful methods.

394.0k1](/packages/webdevstudios-taxonomy-core)[metabolism/wp-steroids

Supercharge Wordpress with YML configuration, increase performance and security

237.1k1](/packages/metabolism-wp-steroids)[zman/zman

A Jewish date converter and helper.

186.4k](/packages/zman-zman)[pudongping/hyperf-wise-locksmith

A mutex library provider for the Hyperf framework, designed to enable serialized execution of PHP code in high-concurrency scenarios.

106.3k2](/packages/pudongping-hyperf-wise-locksmith)

PHPackages © 2026

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