Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hyphen in pelias peliasNameTokenizer and peliasStreetTokenizer #375

Merged
merged 1 commit into from
Sep 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions integration/analyzer_peliasIndexOneEdgeGram.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports.tests.analyze = function(test, common){
assertAnalysis( 'keyword_street_suffix', 'ctr', ['c', 'ct', 'ctr', 'ce', 'cen', 'cent', 'cente', 'center'] );

assertAnalysis( 'peliasIndexOneEdgeGramFilter', '1 a ab abc abcdefghij', [
'1', 'a', 'a', 'ab', 'a', 'ab', 'abc', 'a', 'ab', 'abc',
'1', 'a', 'a', 'ab', 'a', 'ab', 'abc', 'a', 'ab', 'abc',
'abcd', 'abcde', 'abcdef', 'abcdefg', 'abcdefgh', 'abcdefghi', 'abcdefghij'
] );
assertAnalysis( 'removeAllZeroNumericPrefix', '00001', ['1'] );
Expand All @@ -58,7 +58,7 @@ module.exports.tests.analyze = function(test, common){
assertAnalysis( 'no kstem', 'peoples', ['p', 'pe', 'peo', 'peop', 'peopl', 'people', 'peoples'] );

// remove punctuation (handled by the char_filter)
assertAnalysis( 'punctuation', punctuation.all.join(''), ['-','-&'] );
assertAnalysis( 'punctuation', punctuation.all.join(''), ['&', 'a', 'an', 'and', 'u', 'un', 'und'] );
assertAnalysis( 'punctuation', 'Hawai‘i', ['h', 'ha', 'haw', 'hawa', 'hawai', 'hawaii'] );

// ensure that very large grams are created
Expand Down
2 changes: 1 addition & 1 deletion integration/analyzer_peliasPhrase.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports.tests.analyze = function(test, common){
assertAnalysis( 'stem direction synonyms', '20 bear road northeast', ['0:20', '1:bear', '2:road', '2:rd', '3:northeast', '3:ne'], true );

// remove punctuation (handled by the char_filter)
assertAnalysis( 'punctuation', punctuation.all.join(''), [ '-&' ] );
assertAnalysis( 'punctuation', punctuation.all.join(''), ['&', 'and', 'und'] );
assertAnalysis( 'punctuation', 'Hawai‘i', ['hawaii'] );

suite.run( t.end );
Expand Down
2 changes: 1 addition & 1 deletion integration/analyzer_peliasQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports.tests.analyze = function(test, common){
assertAnalysis('no kstem', 'peoples', ['peoples']);

// remove punctuation (handled by the char_filter)
assertAnalysis( 'punctuation', punctuation.all.join(''), ['-&'] );
assertAnalysis( 'punctuation', punctuation.all.join(''), ['&'] );

suite.run( t.end );
});
Expand Down
2 changes: 1 addition & 1 deletion integration/analyzer_peliasQueryFullToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module.exports.tests.analyze = function(test, common){
assertAnalysis( 'no kstem', 'peoples', ['peoples'] );

// remove punctuation (handled by the char_filter)
assertAnalysis( 'punctuation', punctuation.all.join(''), ['-&'] );
assertAnalysis( 'punctuation', punctuation.all.join(''), ['&', 'and', 'und'] );

// ensure that very large tokens are created
assertAnalysis( 'largeGrams', 'grolmanstrasse', [ 'grolmanstrasse' ]);
Expand Down
2 changes: 1 addition & 1 deletion integration/analyzer_peliasQueryPartialToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports.tests.analyze = function(test, common){
assertAnalysis( 'no kstem', 'peoples', ['peoples'] );

// remove punctuation (handled by the char_filter)
assertAnalysis( 'punctuation', punctuation.all.join(''), ['-&'] );
assertAnalysis( 'punctuation', punctuation.all.join(''), ['&', 'and', 'und'] );

// ensure that very large grams are created
assertAnalysis( 'largeGrams', 'grolmanstrasse', ['grolmanstrasse']);
Expand Down
2 changes: 1 addition & 1 deletion integration/analyzer_peliasStreet.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports.tests.analyze = function(test, common){
suite.action( function( done ){ setTimeout( done, 500 ); }); // wait for es to bring some shards up

assertAnalysis( 'lowercase', 'F', ['f']);
assertAnalysis( 'asciifolding', 'Max-Beer-Straße', ['max-beer-strasse']);
assertAnalysis( 'asciifolding', 'Max-Beer-Straße', ['max', 'beer', 'strasse', 'str']);
assertAnalysis( 'trim', ' f ', ['f'] );
assertAnalysis( 'keyword_street_suffix', 'foo Street', ['0:foo', '1:street', '1:st'], true );
assertAnalysis( 'keyword_street_suffix', 'foo Road', ['0:foo', '1:road', '1:rd'], true );
Expand Down
4 changes: 2 additions & 2 deletions settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ function generate(){
"tokenizer": {
"peliasNameTokenizer": {
"type": "pattern",
"pattern": "[\\s,/\\\\]+"
"pattern": "[\\s,/\\\\-]+"
},
"peliasStreetTokenizer": {
"type": "pattern",
"pattern": "[\\s,/\\\\]+"
"pattern": "[\\s,/\\\\-]+"
}
},
"analyzer": {
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"tokenizer": {
"peliasNameTokenizer": {
"type": "pattern",
"pattern": "[\\s,/\\\\]+"
"pattern": "[\\s,/\\\\-]+"
},
"peliasStreetTokenizer": {
"type": "pattern",
"pattern": "[\\s,/\\\\]+"
"pattern": "[\\s,/\\\\-]+"
}
},
"analyzer": {
Expand Down