Repository navigation
0.141.0: name_finder, a world's element names found in prose - #38
Merged
Merged
Conversation
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>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
name_finder(elements, case=...): a world's element names found in prose. It reads the names once and answersfind(text), everyNameFound(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.caseis 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.The README's Addresses section said finding where an address starts was the caller's work;
find_ow_linksdoes it.🤖 Generated with Claude Code