Skip to content

Commit

Permalink
Merge pull request #475 from pelias/postalcodes-removeLeadingZero
Browse files Browse the repository at this point in the history
Add filter to remove leading zeros to `peliasPhrase` analyzer
  • Loading branch information
orangejulius authored Feb 18, 2021
2 parents 210a328 + 8a6ac3a commit 7eca249
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions integration/analyzer_peliasPhrase.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ module.exports.tests.analyze = function(test, common){
assertAnalysis( 'british_american_english', 'town theatre', ['0:town', '1:theatre', '1:theater'] );
assertAnalysis( 'british_american_english', 'town theater', ['0:town', '1:theater', '1:theatre'] );

// remove leading zeros from numeric input
assertAnalysis( 'leading_zeros', '01000', ['0:1000'] );
assertAnalysis( 'leading_zeros', '09999', ['0:9999'] );

suite.run( t.end );
});
Expand Down
1 change: 1 addition & 0 deletions settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ function generate(){
"name_synonyms_multiplexer",
"icu_folding",
"remove_ordinals",
"removeAllZeroNumericPrefix",
"unique_only_same_position",
"notnull",
"flatten_graph"
Expand Down
3 changes: 2 additions & 1 deletion test/fixtures/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"name_synonyms_multiplexer",
"icu_folding",
"remove_ordinals",
"removeAllZeroNumericPrefix",
"unique_only_same_position",
"notnull",
"flatten_graph"
Expand Down Expand Up @@ -3049,4 +3050,4 @@
},
"dynamic": "strict"
}
}
}
1 change: 1 addition & 0 deletions test/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ module.exports.tests.peliasPhraseAnalyzer = function(test, common) {
"name_synonyms_multiplexer",
"icu_folding",
"remove_ordinals",
"removeAllZeroNumericPrefix",
"unique_only_same_position",
"notnull",
"flatten_graph"
Expand Down

0 comments on commit 7eca249

Please sign in to comment.