Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add string/base/distances/hamming #1166

Merged
merged 25 commits into from
Dec 15, 2023
Merged

Conversation

rgizz
Copy link
Contributor

@rgizz rgizz commented Dec 8, 2023

Description

What is the purpose of this pull request?

This pull request adds an API for computing the Hamming distance between two strings by comparing UTF-16 code units.

Related Issues

Does this pull request have any related issues?

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

Yes. The feature is named hamming2 in order to distinguish it from an earlier effort that was discontinued. The better name would be, of course, hamming.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

Beginning of addition of this feature
Adding test.js
use of wrong term corrected
add README.md
add explanation of returning sentinel value of -1 if strings differ
in length
Strings outside the Basic Multilingual Plane are warned against
add package.json
add the standard file examples/index/js
add standard file benchmark.js
…at/hamming2

Commit necessary per advice of Mr. Reines.
add standard file repl.txt
add standard file index.d.ts
add standard file test.ts
add standard file lib/index.js
revise README.md, correcting and rephrasing
revised repl.txt to add equal-length and sentinel value
further minor revisions for clarity and to be more informative
revise index.d.ts to state equal length requirement and
sentinel value of -1
changed 'throws' to 'returns'
delete code relating to testing Unicode values
added example illustrating -1 returned for different length strings
@kgryte kgryte added the Feature Issue or pull request for adding a new feature. label Dec 9, 2023
@kgryte kgryte assigned kgryte and unassigned kgryte Dec 9, 2023
@kgryte kgryte self-requested a review December 9, 2023 22:02
@kgryte kgryte changed the title Feat/hamming2 feat: add string/base/distances/hamming Dec 9, 2023
Signed-off-by: Athan <kgryte@gmail.com>
Copy link
Member

@kgryte kgryte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks, @rgizz!

@kgryte kgryte merged commit 165ab63 into stdlib-js:develop Dec 15, 2023
7 checks passed
@kgryte kgryte deleted the feat/hamming2 branch December 15, 2023 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Issue or pull request for adding a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants