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

capture all terminators and quotes in the sentence #360

Merged
merged 10 commits into from
Dec 19, 2023

Conversation

Casheeew
Copy link
Member

This PR resolves #116 . It should capture all termination characters or quotes if it appears multiple times at the beginning or end of a sentence. When tested on sentences, it behaves the same as the original but grabs all termination characters.

@Casheeew Casheeew requested a review from a team as a code owner December 13, 2023 11:06
Copy link

github-actions bot commented Dec 13, 2023

⚠️ Visual differences introduced by this PR; please validate if they are desirable.

View Playwright Report (note: open the "playwright-report" artifact)

@djahandarie
Copy link
Collaborator

Thanks! Could you add an extra comment or two, and/or make the variables a little more descriptive? (This isn't quite your fault, but I think the code is a bit hard to understand here...)

Copy link

@toasted-nutbread toasted-nutbread left a comment

Choose a reason for hiding this comment

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

Would be great to get some test coverage for this case, but also as I was looking into this, I realized that document-util tests are broken. I'll fix those.

ext/js/dom/document-util.js Outdated Show resolved Hide resolved
ext/js/dom/document-util.js Outdated Show resolved Hide resolved
ext/js/dom/document-util.js Outdated Show resolved Hide resolved
ext/js/dom/document-util.js Show resolved Hide resolved
@toasted-nutbread
Copy link

Would be great to get some test coverage for this case, but also as I was looking into this, I realized that document-util tests are broken. I'll fix those.

#363 fixes this; once that's merged, rebase off the latest master and tests can be added to test\data\html\test-document1.html.

Here is a new example test which I think will be affected by this update:

    <div
        class="test"
        data-test-type="scan"
        data-element-from-point-selector="span"
        data-caret-range-from-point-selector="span"
        data-start-node-selector="span"
        data-start-offset="4"
        data-end-node-selector="span"
        data-end-offset="4"
        data-result-type="TextSourceRange"
        data-sentence-scan-extent="100"
        data-sentence="ありがとございます。"
    >
        <span>ありがとございます。!?ありがとございます。!?</span>
    </div>

djahandarie
djahandarie previously approved these changes Dec 17, 2023
Copy link
Collaborator

@djahandarie djahandarie left a comment

Choose a reason for hiding this comment

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

Thanks for making the fixes! LGTM, but let's also wait for @toasted-nutbread's review.

@djahandarie djahandarie added this pull request to the merge queue Dec 19, 2023
Merged via the queue into yomidevs:master with commit 521e87d Dec 19, 2023
6 checks passed
@Casheeew Casheeew deleted the parse-punctuation branch December 19, 2023 03:56
@djahandarie djahandarie added the kind/bug The issue or PR is regarding a bug label Dec 20, 2023
@Casheeew Casheeew restored the parse-punctuation branch December 23, 2023 06:48
@Casheeew Casheeew deleted the parse-punctuation branch December 25, 2023 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug The issue or PR is regarding a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an ability to capture all punctuation at the end of a sentence
3 participants