From 163edfec77565e2b6ae36f45c085ad840ee553fb Mon Sep 17 00:00:00 2001 From: upstream Date: Sat, 3 Oct 2026 03:06:19 +0200 Subject: [PATCH] Upstream spencermountain/compromise state of the touched files before d01da120a4 --- src/2-two/contraction-two/api/contract.js | 4 ++-- tests/two/contractions/contract.test.js | 17 ----------------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/2-two/contraction-two/api/contract.js b/src/2-two/contraction-two/api/contract.js index 0cd8976..c697bf7 100644 --- a/src/2-two/contraction-two/api/contract.js +++ b/src/2-two/contraction-two/api/contract.js @@ -45,8 +45,8 @@ const contract = function () { // spencer would -> spencer'd m = doc.match('#Person would') setContraction(m, `'d`) - // would not -> wouldn't (skip words already contracted above, like he's) - m = doc.match('(is|was|had|would|should|could|do|does|have|has|can) not').ifNo('@hasContraction') + // would not -> wouldn't + m = doc.match('(is|was|had|would|should|could|do|does|have|has|can) not') setContraction(m, `n't`) // i have -> i've m = doc.match('(i|we|they) have') diff --git a/tests/two/contractions/contract.test.js b/tests/two/contractions/contract.test.js index b2599e1..79f153b 100644 --- a/tests/two/contractions/contract.test.js +++ b/tests/two/contractions/contract.test.js @@ -41,23 +41,6 @@ test('contract basic', function (t) { t.end() }) -test('contract before not', function (t) { - let doc = nlp('he is not here') - doc.contract() - t.equal(doc.text(), `he's not here`, here + 'he is not') - doc.contractions().expand() - t.equal(doc.text(), 'he is not here', here + 'he is not expand') - - doc = nlp('spencer is not here') - doc.contract() - t.equal(doc.text(), `spencer's not here`, here + 'spencer is not') - - doc = nlp('that is not true') - doc.contract() - t.equal(doc.text(), `that isn't true`, here + 'that is not') - t.end() -}) - test('avoid contraction messes', function (t) { let doc = nlp('Tony, is').contract() t.equal(doc.has('is'), true, here + 'avoid-contraction 1')