Skip to content

Remove GPL/LGPL-derived string handling and transliteration - #42

Closed
jfstenuit wants to merge 1 commit into
wamania:masterfrom
jfstenuit:master
Closed

jfstenuit wants to merge 1 commit into
wamania:masterfrom
jfstenuit:master

Conversation

@jfstenuit

Copy link
Copy Markdown
  • Drop the joomla/string dependency (GPL-2.0-or-later, incompatible with this MIT package). Its StringHelper was a thin pass-through to mbstring for every method used here, so call mb_substr/mb_strtolower/mb_strlen/ mb_strpos/mb_strrpos directly across StemmerFactory and all Stemmer classes. composer.json now requires ext-mbstring instead.

  • Rewrite src/Transliterate.php's accent-folding table. It was a verbatim copy of Joomla's transliterate class, itself a port of phputf8's utf8_accents_to_ascii() - traceable to fluxbb/utf8, which is LGPL-2.1. Re-derived the same 105 lower / 103 upper mappings independently from each character's Unicode identity (canonical decomposition for diacritics, standard romanization convention for ß/þ/ð/æ/œ/ø/ł/đ/ħ/ƒ/µ and the German umlauts), matching Unicode CLDR's Latin-ASCII/de-ASCII transforms rather than any single third-party table.

  • Update README's PHP 8.4 install note to explain the actual rationale chain (voku/portable-utf8 -> joomla/string -> native mbstring) instead of the outdated "avoid deprecated" framing.

… + original transliteration table

- Drop the joomla/string dependency (GPL-2.0-or-later, incompatible with
  this MIT package). Its StringHelper was a thin pass-through to mbstring
  for every method used here, so call mb_substr/mb_strtolower/mb_strlen/
  mb_strpos/mb_strrpos directly across StemmerFactory and all Stemmer
  classes. composer.json now requires ext-mbstring instead.

- Rewrite src/Transliterate.php's accent-folding table. It was a verbatim
  copy of Joomla's transliterate class, itself a port of phputf8's
  utf8_accents_to_ascii() — traceable to fluxbb/utf8, which is LGPL-2.1.
  Re-derived the same 105 lower / 103 upper mappings independently from
  each character's Unicode identity (canonical decomposition for
  diacritics, standard romanization convention for ß/þ/ð/æ/œ/ø/ł/đ/ħ/ƒ/µ
  and the German umlauts), matching Unicode CLDR's Latin-ASCII/de-ASCII
  transforms rather than any single third-party table.

- Update README's PHP 8.4 install note to explain the actual rationale
  chain (voku/portable-utf8 -> joomla/string -> native mbstring) instead
  of the outdated "avoid deprecated" framing.
@HLeithner

Copy link
Copy Markdown
Collaborator

please look at https://github.com/wamania/php-stemmer/tree/5.0-dev this already has the GPL dependency removed

@HLeithner HLeithner closed this Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants