compromise
compromise copied to clipboard
Semicolon should be equivalent to period
A semicolon ends a complete sentence and should be treated like a period when tagging.
Here's my surprising finding, replicated on Observable:
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.
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.
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.
This reference might be relevant: https://writingcenter.unc.edu/tips-and-tools/semi-colons-colons-and-dashes/
Hey @ProfJanetDavis ! Could you give an example of how you're using the replaceWith
? Would be great to debug any issues with it.
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