Skip to content

0.141.0: name_finder, a world's element names found in prose - #38

Merged
tmoosting merged 1 commit into
mainfrom
name-finder
Nov 23, 2026
Merged

tmoosting merged 1 commit into
mainfrom
name-finder

Conversation

@tmoosting

Copy link
Copy Markdown
Member

name_finder(elements, case=...): a world's element names found in prose. It reads the names once and answers find(text), every NameFound (start, end, element) in order. It finds and never writes.

The same rule as the npm SDK's nameFinder (4.194.0): a whole name only, by a Unicode word edge; trimmed, three characters at least; the longest whole name where several start at one place; a name two elements share is never answered; nothing inside an address or a Markdown link. case is required ("exact" or "folded"), with no default.

How it is held:

  • tests/fixtures/name-finder.cases.json: the same bytes as the SDK's copy (47 cases, each want marked by hand there, and seven timed recipes); both tests pin the sha256.
  • 25 faults planted one at a time in the source each turned the test red, with the control green before and after. Two more, which loop without end, are held in the SDK's run only.
  • The two packages answered 2,104 random texts over 600 made worlds the same, with one planted difference seen as a failure.

The README's Addresses section said finding where an address starts was the caller's work; find_ow_links does it.

🤖 Generated with Claude Code

name_finder(elements, case=...) reads the names once and answers find(text): every NameFound (start, end, element) in order, element being the object passed in. It finds and never writes. A whole name only, by a Unicode word edge (a letter, a combining mark, a decimal digit or an underscore on either side is inside a word); trimmed, three characters at least; the longest whole name where several start at one place; a name two elements share is never answered, nor anything inside it; nothing inside an address or a Markdown link. case is required, "exact" or "folded" (simple case folding), with no default.

The same rule as the npm SDK's nameFinder (4.194.0), on the same file of cases (tests/fixtures/name-finder.cases.json, 47, both tests pin its sha256). start and end count code points here, UTF-16 units there.

Also: the README's Addresses section said finding where an address starts was the caller's work; find_ow_links does it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@tmoosting
tmoosting merged commit 4e9e90f into main Nov 23, 2026
11 checks passed
@tmoosting
tmoosting deleted the name-finder branch November 23, 2026 14:50

This branch was successfully deployed

1 active deployment
pypi — 4e9e90f5 Deployed Nov 23, 2026 by tmoosting via publish #228
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.

1 participant