Skip to content

Commit

Permalink
feat(punctuation): Strip lower german quotation mark (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
taygun authored Oct 28, 2021
1 parent d95d6f7 commit fdd997f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions integration/analyzer_peliasIndexOneEdgeGram.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports.tests.analyze = function(test, common){
'1:a',
'2:a', '2:ab',
'3:a', '3:ab', '3:abc',
'4:a', '4:ab', '4:abc', '4:abcd', '4:abcde', '4:abcdef',
'4:a', '4:ab', '4:abc', '4:abcd', '4:abcde', '4:abcdef',
'4:abcdefg', '4:abcdefgh', '4:abcdefghi', '4:abcdefghij'
] );
assertAnalysis( 'removeAllZeroNumericPrefix', '00001', ['1'] );
Expand All @@ -69,7 +69,7 @@ module.exports.tests.analyze = function(test, common){
// remove punctuation (handled by the char_filter)
assertAnalysis('punctuation', punctuation.all.join(''), ['0:&', '0:a', '0:an', '0:and', '0:u', '0:un', '0:und'] );
assertAnalysis( 'punctuation', 'Hawai‘i', ['0:h', '0:ha', '0:haw', '0:hawa', '0:hawai', '0:hawaii'] );

assertAnalysis( 'punctuation', '„Tip Top”', ['0:t', '0:ti', '0:tip', '1:t', '1:to', '1:top'] );
// ensure that very large grams are created
assertAnalysis( 'largeGrams', 'grolmanstrasse', [
'0:g', '0:gr', '0:gro', '0:grol', '0:grolm', '0:grolma', '0:grolman', '0:grolmans',
Expand Down
2 changes: 1 addition & 1 deletion punctuation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
module.exports.all = [
".","`","‘","-","_","=","?","'","|","\"","(",")","{","}","[","]","<",">","*",
"#","&","^","$","@","!","~",":",";","+","《","》","—","-",",","。",
"、", ":",";","!","·","?","“","”",")","(","【","】","[","]","●"
"、", ":",";","!","·","?","„","“","”",")","(","【","】","[","]","●"
];

module.exports.allowed = [
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -2313,6 +2313,7 @@
"!=>",
"·=>",
"?=>",
"„=>",
"“=>",
"”=>",
")=>",
Expand Down
2 changes: 1 addition & 1 deletion test/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ module.exports.tests.punctuationCharFilter = function(test, common) {
var char_filter = s.analysis.char_filter.punctuation;
t.equal(char_filter.type, 'mapping');
t.true(Array.isArray(char_filter.mappings));
t.equal(char_filter.mappings.length, 48);
t.equal(char_filter.mappings.length, 49);
t.end();
});
};
Expand Down

0 comments on commit fdd997f

Please sign in to comment.