-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(punctuation): amend punctuation list
- Loading branch information
1 parent
9fb43bc
commit 629e0e6
Showing
4 changed files
with
23 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,18 @@ | ||
// These characters will be removed from ngrams/shingles | ||
// @see: org/apache/lucene/analysis/cn/smart/stopwords.txt | ||
|
||
module.exports.all = [ | ||
".","`","‘","-","_","=","?","'","|","\"","(",")","{","}","[","]","<",">","*", | ||
"#","&","^","$","@","!","~",":",";","+","《","》","—","-",",","。", | ||
"、", ":",";","!","·","?","„","“","”",")","(","【","】","[","]","●" | ||
const all = [ | ||
".","`","‘","’","‛","-","_","=","?","'","|","\"","(",")","{","}","[","]","<",">","*", | ||
"#","&","^","$","@","!","~",":",";","+","《","》","—","-",",","。","‹","›","⹂","〝","〞", | ||
"、", ":",";","!","·","?","„","“","”","‟",")","(","【","】","[","]","●","«","»" | ||
]; | ||
|
||
module.exports.allowed = [ | ||
const allowed = [ | ||
"-", // allow hypens | ||
"&" // allow ampersands | ||
]; | ||
|
||
module.exports.blacklist = module.exports.all.slice(); | ||
|
||
// remove alowed chars from blacklist | ||
module.exports.allowed.forEach(function(item){ | ||
var index = module.exports.blacklist.indexOf(item); | ||
if( index > -1 ){ | ||
module.exports.blacklist.splice(index, 1); | ||
} | ||
}); | ||
const blacklist = all.filter(s => !allowed.includes(s)); | ||
|
||
module.exports = { all, allowed, blacklist }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters