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

Add normalization of combining dakuten and handakuten to ja preprocessors #1136

Merged
merged 5 commits into from
Jun 26, 2024

Conversation

Kuuuube
Copy link
Member

@Kuuuube Kuuuube commented Jun 26, 2024

Fixes #1116
Possibly optimization overkill. The way I wrote it is 6x faster than the dead simple way of regex + normalize:

text.replace(/.(\u3099|\u309A)/g, (match) => {
    return match.normalize();
});

But idk if it's worth the code (probably) looking like witchcraft to someone else that sees it.

Also probably needs some cases added to tests.

@Kuuuube Kuuuube added kind/enhancement The issue or PR is a new feature or request area/linguistics The issue or PR is related to linguistics labels Jun 26, 2024
@Kuuuube Kuuuube requested a review from a team as a code owner June 26, 2024 03:54
Copy link
Collaborator

@Casheeew Casheeew left a comment

Choose a reason for hiding this comment

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

The code looks pretty clear to me, and considering dakutens appear quite often faster probably brings no harm

ext/js/language/ja/japanese.js Outdated Show resolved Hide resolved
@Kuuuube
Copy link
Member Author

Kuuuube commented Jun 26, 2024

Added tests. This should be good to go.

@Kuuuube Kuuuube enabled auto-merge June 26, 2024 17:02
@Kuuuube Kuuuube added this pull request to the merge queue Jun 26, 2024
Merged via the queue into themoeway:master with commit dfc3710 Jun 26, 2024
10 checks passed
@Kuuuube Kuuuube deleted the fix-combinings branch June 26, 2024 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/linguistics The issue or PR is related to linguistics kind/enhancement The issue or PR is a new feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

does not recognize dakuten when marked using U+3099
3 participants