Skip to content

Commit

Permalink
Fix backslashes in words
Browse files Browse the repository at this point in the history
Closes GH-13.

Reviewed-by: Titus Wormer <[email protected]>
  • Loading branch information
MichaelChambers authored May 8, 2020
1 parent adae975 commit 773c1fc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
20 changes: 10 additions & 10 deletions index.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"came",
"camp",
"can",
"can\\'t",
"can't",
"candle",
"candy",
"cap",
Expand Down Expand Up @@ -221,7 +221,7 @@
"deep",
"desk",
"did",
"didn\\'t",
"didn't",
"die",
"different",
"dig",
Expand All @@ -236,7 +236,7 @@
"does",
"dog",
"dollar",
"don\\'t",
"don't",
"done",
"door",
"down",
Expand Down Expand Up @@ -395,7 +395,7 @@
"hate",
"have",
"he",
"he\\'s",
"he's",
"head",
"hear",
"heard",
Expand Down Expand Up @@ -437,8 +437,8 @@
"hurt",
"husband",
"i",
"i\\'ll",
"i\\'m",
"i'll",
"i'm",
"ice",
"idea",
"if",
Expand All @@ -453,7 +453,7 @@
"invite",
"is",
"it",
"it\\'s",
"it's",
"its",
"j",
"jacket",
Expand Down Expand Up @@ -500,7 +500,7 @@
"leg",
"less",
"let",
"let\\'s",
"let's",
"letter",
"lick",
"lift",
Expand Down Expand Up @@ -902,7 +902,7 @@
"than",
"thank",
"that",
"that\\'s",
"that's",
"the",
"their",
"them",
Expand Down Expand Up @@ -1037,7 +1037,7 @@
"wolf",
"woman",
"women",
"won\\'t",
"won't",
"wonder",
"wood",
"word",
Expand Down
2 changes: 2 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})

0 comments on commit 773c1fc

Please sign in to comment.