{"id":15026694,"url":"https://github.com/amaccis/php-stemmer","last_synced_at":"2025-08-27T13:18:54.496Z","repository":{"id":46126699,"uuid":"242366259","full_name":"amaccis/php-stemmer","owner":"amaccis","description":"A PHP interface to the Snowball stemming algorithms","archived":false,"fork":false,"pushed_at":"2025-05-08T21:21:42.000Z","size":68,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-15T17:36:31.243Z","etag":null,"topics":["ffi","libstemmer","php-libstemmer","php74","php8","snowball"],"latest_commit_sha":null,"homepage":"","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/amaccis.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":"2020-02-22T15:39:53.000Z","updated_at":"2025-05-08T21:17:30.000Z","dependencies_parsed_at":"2024-09-28T20:01:14.776Z","dependency_job_id":"86b90f25-d1f2-48d0-8863-6ee3a480b605","html_url":"https://github.com/amaccis/php-stemmer","commit_stats":{"total_commits":63,"total_committers":1,"mean_commits":63.0,"dds":0.0,"last_synced_commit":"6e3c898b43eee684252a35c2fd5f020642c49688"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/amaccis/php-stemmer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amaccis%2Fphp-stemmer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amaccis%2Fphp-stemmer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amaccis%2Fphp-stemmer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amaccis%2Fphp-stemmer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amaccis","download_url":"https://codeload.github.com/amaccis/php-stemmer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amaccis%2Fphp-stemmer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272335627,"owners_count":24916504,"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","status":"online","status_checked_at":"2025-08-27T02:00:09.397Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ffi","libstemmer","php-libstemmer","php74","php8","snowball"],"created_at":"2024-09-24T20:04:53.959Z","updated_at":"2025-08-27T13:18:54.478Z","avatar_url":"https://github.com/amaccis.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-stemmer\n\n[![PHP Version](https://img.shields.io/badge/php-%5E8.1-blue.svg)](https://img.shields.io/badge/php-%5E8.1-blue.svg)\n![CI](https://github.com/amaccis/php-stemmer/workflows/CI/badge.svg)\n\n## What is PHP Stemmer?\nPHP Stemmer is a PHP interface to the stemming algorithms from the [Snowball project](https://snowballstem.org/), largely inspired by Richard Boulton's [PyStemmer](https://github.com/snowballstem/pystemmer).\nIt uses FFI (PHP \u003e= 7.4.0) and expects to find the file libstemmer.so (a version of [Libstemmer](https://snowballstem.org/dist/libstemmer_c.tgz) compiled as shared library) in LD_LIBRARY_PATH.  \nIn order to set up this kind of environment you can take a look at [docker-php-libstemmer](https://github.com/amaccis/docker-php-libstemmer) Dockerfile or you can use the corresponding docker image: [amaccis/php-libstemmer](https://hub.docker.com/r/amaccis/php-libstemmer)\n\n## Installation\n\nPHP Stemmer is available on [Packagist](http://packagist.org/packages/amaccis/php-stemmer), \nyou can install it using [Composer](http://getcomposer.org).\n\n```shell\ncomposer require amaccis/php-stemmer\n```\n\n## Usage\n\n```php\n\u003c?php\n\nuse Amaccis\\Stemmer\\Stemmer;\nuse Amaccis\\Stemmer\\Enum\\CharacterEncodingEnum;\n\n$algorithms = Stemmer::algorithms();\nvar_dump($algorithms);\n/*\narray(29) {\n  [0] =\u003e\n  string(6) \"arabic\"\n  [1] =\u003e\n  string(8) \"armenian\"\n  [2] =\u003e\n  string(6) \"basque\"\n  [3] =\u003e\n  string(7) \"catalan\"\n  [4] =\u003e\n  string(6) \"danish\"\n  [5] =\u003e\n  string(5) \"dutch\"\n  [6] =\u003e\n  string(7) \"english\"\n  [7] =\u003e\n  string(7) \"finnish\"\n  [8] =\u003e\n  string(6) \"french\"\n  [9] =\u003e\n  string(6) \"german\"\n  [10] =\u003e\n  string(5) \"greek\"\n  [11] =\u003e\n  string(5) \"hindi\"\n  [12] =\u003e\n  string(9) \"hungarian\"\n  [13] =\u003e\n  string(10) \"indonesian\"\n  [14] =\u003e\n  string(5) \"irish\"\n  [15] =\u003e\n  string(7) \"italian\"\n  [16] =\u003e\n  string(10) \"lithuanian\"\n  [17] =\u003e\n  string(6) \"nepali\"\n  [18] =\u003e\n  string(9) \"norwegian\"\n  [19] =\u003e\n  string(6) \"porter\"\n  [20] =\u003e\n  string(10) \"portuguese\"\n  [21] =\u003e\n  string(8) \"romanian\"\n  [22] =\u003e\n  string(7) \"russian\"\n  [23] =\u003e\n  string(7) \"serbian\"\n  [24] =\u003e\n  string(7) \"spanish\"\n  [25] =\u003e\n  string(7) \"swedish\"\n  [26] =\u003e\n  string(5) \"tamil\"\n  [27] =\u003e\n  string(7) \"turkish\"\n  [28] =\u003e\n  string(7) \"yiddish\"\n}\n*/\n\n$algorithm = \"english\";\n$word = \"cycling\";\n$stemmer = new Stemmer($algorithm); // default character encoding is UTF-8\n$stem = $stemmer-\u003estemWord($word);\nvar_dump($stem);\n/*\nstring(4) \"cycl\"\n*/\n\n$algorithm = \"basque\";\n$word = \"aberatsenetakoa\";\n$stemmer = new Stemmer($algorithm, CharacterEncodingEnum::ISO_8859_1);\n$stem = $stemmer-\u003estemWord($word);\nvar_dump($stem);\n/*\nstring(8) \"aberatse\"\n*/\n```\n\n## License\nAll files are MIT \u0026copy; [Andrea Maccis](https://twitter.com/andreamaccis) except for _resources/libstemmer.h_ BSD-3 \u0026copy; [Snowball Project](https://github.com/snowballstem/snowball).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famaccis%2Fphp-stemmer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famaccis%2Fphp-stemmer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famaccis%2Fphp-stemmer/lists"}