From b02a460a7d556c8111bb55bb8bd909696dfa5b58 Mon Sep 17 00:00:00 2001 From: Michael Chambers Date: Thu, 7 May 2020 14:33:26 -0400 Subject: [PATCH 1/2] Remove backslashes from words with apostrophe. --- index.json | 20 ++++++++++---------- test.js | 2 ++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/index.json b/index.json index 22b60a2..a0ff3fa 100644 --- a/index.json +++ b/index.json @@ -142,7 +142,7 @@ "came", "camp", "can", - "can\\'t", + "can't", "candle", "candy", "cap", @@ -221,7 +221,7 @@ "deep", "desk", "did", - "didn\\'t", + "didn't", "die", "different", "dig", @@ -236,7 +236,7 @@ "does", "dog", "dollar", - "don\\'t", + "don't", "done", "door", "down", @@ -395,7 +395,7 @@ "hate", "have", "he", - "he\\'s", + "he's", "head", "hear", "heard", @@ -437,8 +437,8 @@ "hurt", "husband", "i", - "i\\'ll", - "i\\'m", + "i'll", + "i'm", "ice", "idea", "if", @@ -453,7 +453,7 @@ "invite", "is", "it", - "it\\'s", + "it's", "its", "j", "jacket", @@ -500,7 +500,7 @@ "leg", "less", "let", - "let\\'s", + "let's", "letter", "lick", "lift", @@ -902,7 +902,7 @@ "than", "thank", "that", - "that\\'s", + "that's", "the", "their", "them", @@ -1037,7 +1037,7 @@ "wolf", "woman", "women", - "won\\'t", + "won't", "wonder", "wood", "word", diff --git a/test.js b/test.js index 50edadd..e5eeca8 100644 --- a/test.js +++ b/test.js @@ -7,6 +7,8 @@ test('spache', function(t) { t.equal(typeof spache, 'object', 'should be an array #1') t.equal(Array.isArray(spache), true, 'should be an array #2') t.notEqual(spache.indexOf('train'), -1, 'should contain words') + t.notEqual(spache.indexOf("can't"), -1, "should contain can't") + t.equal(spache.indexOf("aren't"), -1, "should not contain aren't") t.end() }) From 1438be6080d36f4f97d335a35caa2513023cc045 Mon Sep 17 00:00:00 2001 From: Michael Chambers Date: Thu, 7 May 2020 15:43:13 -0400 Subject: [PATCH 2/2] Fix build to not include \\ --- build.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.js b/build.js index ff20f62..331edee 100644 --- a/build.js +++ b/build.js @@ -26,7 +26,7 @@ function onconcat(buf) { var values = selectAll('td p', tree) .map(toString) .join('|') - .replace(/\\/g, "$&'") + .replace(/\\/g, "'") .trim() .split(/\s*\|\s*/g) .filter(Boolean)