compromise icon indicating copy to clipboard operation
compromise copied to clipboard

Semicolon should be equivalent to period

Open ProfJanetDavis opened this issue 5 years ago • 5 comments

A semicolon ends a complete sentence and should be treated like a period when tagging.

Here's my surprising finding, replicated on Observable: Screen Shot 2019-09-09 at 2 36 03 PM The match above is surprising because "mine" starts a new syntactically complete sentence. It is not syntactically involved with the word "his". I expected there to be no matches.

If I change the semicolon to a period, the behavior is exactly as I expect. Screen Shot 2019-09-09 at 2 37 57 PM

ProfJanetDavis avatar Sep 09 '19 13:09 ProfJanetDavis

hey Janet, yeah i see your point. i recommend calling .clauses() before .match. that should do the trick.

it's tricky, I don't want to split the sentences on semicolons, and I don't want to not make the match, because of the semicolon. I tend do use .clauses() before a match, maybe too frequently.

maybe there should be like, .safeMatch() or another parameter, something.

spencermountain avatar Sep 09 '19 14:09 spencermountain

Thanks for the advice. Unfortunately, calling .clauses() before .match() seems to break all of my subsequent calls to replaceWith(). Is there something obvious I'm missing?

I've implemented a workaround with String.split(), but oh man, is it a hack. It would be nice to have the option to treat semicolons - and dashes! - like periods.

ProfJanetDavis avatar Sep 09 '19 20:09 ProfJanetDavis

This reference might be relevant: https://writingcenter.unc.edu/tips-and-tools/semi-colons-colons-and-dashes/

ProfJanetDavis avatar Sep 09 '19 20:09 ProfJanetDavis

Hey @ProfJanetDavis ! Could you give an example of how you're using the replaceWith? Would be great to debug any issues with it.

Drache93 avatar Jan 20 '20 10:01 Drache93

Let me update to Compromise v12 and see if I'm still having this issue. If so, I'll get back to you with a code snippet; if not I'll close the issue. Thanks!

On Mon, Jan 20, 2020 at 2:14 AM Dominic Cassidy [email protected] wrote:

Hey @ProfJanetDavis https://github.com/ProfJanetDavis ! Could you give an example of how you're using the replaceWith? Would be great to debug any issues with it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/spencermountain/compromise/issues/622?email_source=notifications&email_token=AEXJIUZHPYB3MH6APJY4M3TQ6V2QDA5CNFSM4IU3K6M2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJMCWUQ#issuecomment-576203602, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEXJIU5UJAGDJCHEMP5MTSDQ6V2QDANCNFSM4IU3K6MQ .

-- Janet Davis (she/her or they/them) Associate Professor and Microsoft Chair of Computer Science, Whitman College 509-527-5758, http://cs.whitman.edu/~davisj/ Schedule an appointment: http://meetme.so/JanetDavis

ProfJanetDavis avatar Jan 21 '20 17:01 ProfJanetDavis