Skip to content

feat(perturb): add abbrev class for organisation name acronyms - #6

Merged
Divine16 merged 1 commit into
Divine16:mainfrom
iftikhar69:feat/abbrev-perturbation-class
Aug 12, 2026
Merged

Divine16 merged 1 commit into
Divine16:mainfrom
iftikhar69:feat/abbrev-perturbation-class

Conversation

@iftikhar69

Copy link
Copy Markdown
Contributor

What

Adds a new BENIGN perturbation class abbrev to src/ssb/perturb.py.

Why

CONTRIBUTING.md explicitly lists entity/organisation name variation as
unmodelled. Abbreviation is the most common and documented instance of
that gap — "Islamic Revolutionary Guard Corps" screened as "IRGC" is a
real compliance failure pattern.

Distinct from the existing initials class (which targets personal
given-name reduction) in both input domain and output shape.

What changed

  • src/ssb/perturb.py — new _ABBREV_SKIP set and p_abbrev() function
  • tests/test_ssb.py — 6 new tests covering full acronym, partial acronym,
    particle skipping, single-token graceful empty return, no-input-unchanged,
    and correct family assignment

Tests

35/35 pass, zero regressions.

Models the common data-entry pattern where an organisation name is
entered as an acronym (Islamic Revolutionary Guard Corps -> IRGC,
Al-Qaeda Organization -> AQO). Distinct from the existing `initials`
class which targets personal given-name reduction.

Two variants per input:
- Full acronym: all substantive tokens reduced to initials (IRGC)
- Partial acronym: all but last token abbreviated, last kept (IRG Corps)

Particles and legal-form suffixes (al, de, corp, ltd, etc.) are
excluded from abbreviation. Returns empty list for single-token inputs.

Addresses the entity/vessel name gap noted in CONTRIBUTING.md.
@Divine16
Divine16 merged commit 4dde5f0 into Divine16:main Aug 12, 2026
3 checks passed
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