{"id":18486123,"url":"https://github.com/mathsgod/langchain-text-splitter-php","last_synced_at":"2025-05-13T22:13:02.065Z","repository":{"id":224682075,"uuid":"763966520","full_name":"mathsgod/langchain-text-splitter-php","owner":"mathsgod","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-27T08:42:16.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-13T09:03:24.965Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mathsgod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-27T08:37:16.000Z","updated_at":"2024-06-08T09:44:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"76fae8cb-e6b2-4cb0-9cca-383be74e6d0d","html_url":"https://github.com/mathsgod/langchain-text-splitter-php","commit_stats":null,"previous_names":["mathsgod/langchain-text-splitter-php"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Flangchain-text-splitter-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Flangchain-text-splitter-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Flangchain-text-splitter-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Flangchain-text-splitter-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathsgod","download_url":"https://codeload.github.com/mathsgod/langchain-text-splitter-php/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254036843,"owners_count":22003654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T12:47:54.251Z","updated_at":"2025-05-13T22:12:57.056Z","avatar_url":"https://github.com/mathsgod.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# langchain-text-splitter\n\nA simple text splitter that splits text into chunks of a given size with a given overlap.\n\nThis library is based on https://github.com/kambo-1st/langchain-php\n\nIncludes multi language support.\n\n## Installation\n\n```bash\ncomposer require mathsgod/langchain-text-splitter\n```\n\n\n## Example\n\n```php\n\nuse Langchain\\TextSplitter\\RecursiveCharacterTextSplitter;\n\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$ts = new RecursiveCharacterTextSplitter([\n    \"chunk_size\" =\u003e 10,\n    \"chunk_overlap\" =\u003e 2\n]);\n\n$text = \"財政司長陳茂波明日公布新一份財政預算案，焦點之一是會否全面取消樓市逆周期措施。瑞銀發報告認為，在財赤及樓市疲軟下，預料港府會就樓市全面「撤辣」，但按2019年及去年的經驗，相信隨之而來的利好情緒只會維持4至16周，並續料今年樓價會下挫，最新預測會跌5%至10%，而早前的估計是跌少於10%。\";\n\n$chunks = $ts-\u003esplitText($text);\n\nprint_r($chunks);\n/*\nArray\n(\n    [0] =\u003e 財政司長陳茂波明日公\n    [1] =\u003e 日公布新一份財政預算\n    [2] =\u003e 預算案，焦點之一是會\n    [3] =\u003e 是會否全面取消樓市逆\n    [4] =\u003e 市逆周期措施。瑞銀發\n    [5] =\u003e 銀發報告認為，在財赤\n    [6] =\u003e 財赤及樓市疲軟下，預\n    [7] =\u003e ，預料港府會就樓市全\n    [8] =\u003e 市全面「撤辣」，但按\n    [9] =\u003e 但按2019年及去年\n    [10] =\u003e 去年的經驗，相信隨之\n    [11] =\u003e 隨之而來的利好情緒只\n    [12] =\u003e 緒只會維持4至16周\n    [13] =\u003e 6周，並續料今年樓價\n    [14] =\u003e 樓價會下挫，最新預測\n    [15] =\u003e 預測會跌5%至10%\n    [16] =\u003e 0%，而早前的估計是\n    [17] =\u003e 計是跌少於10%。\n)\n*/\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathsgod%2Flangchain-text-splitter-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathsgod%2Flangchain-text-splitter-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathsgod%2Flangchain-text-splitter-php/lists"}