Skip to content

feat: add @stdlib/string/base/distances/hamming-code-points - #1948

Closed
JayPokale wants to merge 8 commits into
stdlib-js:developfrom
JayPokale:hamming-code-points
Closed

JayPokale wants to merge 8 commits into
stdlib-js:developfrom
JayPokale:hamming-code-points

Conversation

@JayPokale

Copy link
Copy Markdown

Description

Calculates the Hamming Code Points Distance distance between two equal-length unicode code points.

Does this pull request have any related issues?

This pull request:

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.

No.

Checklist

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


@stdlib-js/reviewers

@JayPokale

Copy link
Copy Markdown
Author

@Pranavchiku Kindly review this PR.
Looking forward for your reply.

@kgryte kgryte changed the title build: add hamming code points distance calculator feat: add @stdlib/string/base/distances/hamming-code-points Apr 8, 2024
@kgryte kgryte added Feature Issue or pull request for adding a new feature. Needs Review A pull request which needs code review. Utilities Issue or pull request concerning general utilities. labels Apr 8, 2024
}
res = 0;
for ( i = 0; i < s1.length; i++ ) {
if (s1.codePointAt( i ) !== s2.codePointAt( i )) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This implementation is not correct. It will overcount.

@JayPokale JayPokale Apr 17, 2024 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

In new commit I added: if code point value is higher than 0xffff then shift pointer by one to deal with overcount.

@kgryte kgryte added the Needs Changes Pull request which needs changes before being merged. label Apr 8, 2024
@kgryte

kgryte commented Apr 8, 2024

Copy link
Copy Markdown
Member

CI is failing on this PR, and, until the failures are resolved, this PR cannot move forward.

@JayPokale

Copy link
Copy Markdown
Author

Hello Sir @kgryte please review my PR. I changed some logic in the main function.

@JayPokale JayPokale closed this by deleting the head repository Nov 2, 2024
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. Needs Changes Pull request which needs changes before being merged. Needs Review A pull request which needs code review. Utilities Issue or pull request concerning general utilities.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants