Skip to content

Commit

Permalink
Merge pull request #174 from pelias/remove-space-appending-to-directi…
Browse files Browse the repository at this point in the history
…onals

Remove space appending to directionals
  • Loading branch information
trescube authored Sep 16, 2016
2 parents ed12768 + 4f54998 commit fb199c0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
1 change: 1 addition & 0 deletions integration/analyzer_peliasStreet.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports.tests.analyze = function(test, common){
assertAnalysis( 'keyword_street_suffix', 'foo Crescent', ['foo cres'] );
assertAnalysis( 'keyword_compass', 'north foo', ['n foo'] );
assertAnalysis( 'keyword_compass', 'SouthWest foo', ['sw foo'] );
assertAnalysis( 'keyword_compass', 'foo SouthWest', ['foo sw'] );
assertAnalysis( 'remove_ordinals', '1st 2nd 3rd 4th 5th', ['1 2 3 4 5'] );
assertAnalysis( 'remove_ordinals', 'Ast th 101st', ['ast th 101'] );

Expand Down
4 changes: 2 additions & 2 deletions settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ function generate(){
var split = synonym.split(' ');
settings.analysis.filter[ "keyword_compass_" + split[0] ] = {
"type": "pattern_replace",
"pattern": split[0] + " ",
"replacement": split[2] + " "
"pattern": split[0],
"replacement": split[2]
}
});

Expand Down
32 changes: 16 additions & 16 deletions test/fixtures/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -1455,43 +1455,43 @@
},
"keyword_compass_southwest": {
"type": "pattern_replace",
"pattern": "southwest ",
"replacement": "sw "
"pattern": "southwest",
"replacement": "sw"
},
"keyword_compass_southeast": {
"type": "pattern_replace",
"pattern": "southeast ",
"replacement": "se "
"pattern": "southeast",
"replacement": "se"
},
"keyword_compass_northwest": {
"type": "pattern_replace",
"pattern": "northwest ",
"replacement": "nw "
"pattern": "northwest",
"replacement": "nw"
},
"keyword_compass_northeast": {
"type": "pattern_replace",
"pattern": "northeast ",
"replacement": "ne "
"pattern": "northeast",
"replacement": "ne"
},
"keyword_compass_north": {
"type": "pattern_replace",
"pattern": "north ",
"replacement": "n "
"pattern": "north",
"replacement": "n"
},
"keyword_compass_south": {
"type": "pattern_replace",
"pattern": "south ",
"replacement": "s "
"pattern": "south",
"replacement": "s"
},
"keyword_compass_east": {
"type": "pattern_replace",
"pattern": "east ",
"replacement": "e "
"pattern": "east",
"replacement": "e"
},
"keyword_compass_west": {
"type": "pattern_replace",
"pattern": "west ",
"replacement": "w "
"pattern": "west",
"replacement": "w"
}
},
"char_filter": {
Expand Down

0 comments on commit fb199c0

Please sign in to comment.