PHPackages                             mathsgod/langchain-text-splitter - 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. mathsgod/langchain-text-splitter

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

mathsgod/langchain-text-splitter
================================

A PHP library to split text into sentences and words.

1.0.0(2y ago)22.7k↓47.7%MITPHPPHP &gt;=8.0.0

Since Feb 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/mathsgod/langchain-text-splitter-php)[ Packagist](https://packagist.org/packages/mathsgod/langchain-text-splitter)[ RSS](/packages/mathsgod-langchain-text-splitter/feed)WikiDiscussions main Synced 1mo ago

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

langchain-text-splitter
=======================

[](#langchain-text-splitter)

A simple text splitter that splits text into chunks of a given size with a given overlap.

This library is based on

Includes multi language support.

Installation
------------

[](#installation)

```
composer require mathsgod/langchain-text-splitter
```

Example
-------

[](#example)

```
use Langchain\TextSplitter\RecursiveCharacterTextSplitter;

require_once __DIR__ . '/vendor/autoload.php';

$ts = new RecursiveCharacterTextSplitter([
    "chunk_size" => 10,
    "chunk_overlap" => 2
]);

$text = "財政司長陳茂波明日公布新一份財政預算案，焦點之一是會否全面取消樓市逆周期措施。瑞銀發報告認為，在財赤及樓市疲軟下，預料港府會就樓市全面「撤辣」，但按2019年及去年的經驗，相信隨之而來的利好情緒只會維持4至16周，並續料今年樓價會下挫，最新預測會跌5%至10%，而早前的估計是跌少於10%。";

$chunks = $ts->splitText($text);

print_r($chunks);
/*
Array
(
    [0] => 財政司長陳茂波明日公
    [1] => 日公布新一份財政預算
    [2] => 預算案，焦點之一是會
    [3] => 是會否全面取消樓市逆
    [4] => 市逆周期措施。瑞銀發
    [5] => 銀發報告認為，在財赤
    [6] => 財赤及樓市疲軟下，預
    [7] => ，預料港府會就樓市全
    [8] => 市全面「撤辣」，但按
    [9] => 但按2019年及去年
    [10] => 去年的經驗，相信隨之
    [11] => 隨之而來的利好情緒只
    [12] => 緒只會維持4至16周
    [13] => 6周，並續料今年樓價
    [14] => 樓價會下挫，最新預測
    [15] => 預測會跌5%至10%
    [16] => 0%，而早前的估計是
    [17] => 計是跌少於10%。
)
*/
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

811d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/18732337?v=4)[Raymond](/maintainers/mathsgod)[@mathsgod](https://github.com/mathsgod)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/mathsgod-langchain-text-splitter/health.svg)

```
[![Health](https://phpackages.com/badges/mathsgod-langchain-text-splitter/health.svg)](https://phpackages.com/packages/mathsgod-langchain-text-splitter)
```

###  Alternatives

[creatuity/magento2-interceptors

Creatuity Compiled Interceptors Module

136116.5k1](/packages/creatuity-magento2-interceptors)[alexcrawford/lexorank-php

PHP Implementation of JIRA's LexoRank algorithm.

2879.1k1](/packages/alexcrawford-lexorank-php)[unionco/calendarize

A calendar field type providing functionality for recurrence.

1827.2k](/packages/unionco-calendarize)

PHPackages © 2026

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