[formatting] conditional probabilities of template swaps in formatter config
This commit is contained in:
@@ -1,22 +1,9 @@
|
|||||||
global:
|
global:
|
||||||
# Add these components to templates that don't have them
|
# Add these components to templates that don't have them
|
||||||
admin_components:
|
admin_components:
|
||||||
subdivision:
|
|
||||||
after:
|
|
||||||
- road
|
|
||||||
before:
|
|
||||||
- suburb
|
|
||||||
- city_district
|
|
||||||
- city
|
|
||||||
- island
|
|
||||||
- state_district
|
|
||||||
- state
|
|
||||||
- postcode
|
|
||||||
- country
|
|
||||||
suburb:
|
suburb:
|
||||||
after:
|
after:
|
||||||
- road
|
- road
|
||||||
- subdivision
|
|
||||||
before:
|
before:
|
||||||
- city_district
|
- city_district
|
||||||
- city
|
- city
|
||||||
@@ -36,7 +23,7 @@ global:
|
|||||||
- state
|
- state
|
||||||
- postcode
|
- postcode
|
||||||
- country
|
- country
|
||||||
# This is added to all the templates but only makes it in
|
# This is added to all the templates but only makes it into island nations, Hawaii, etc.
|
||||||
island:
|
island:
|
||||||
after:
|
after:
|
||||||
- road
|
- road
|
||||||
@@ -134,10 +121,87 @@ global:
|
|||||||
first: true
|
first: true
|
||||||
probability: 0.1
|
probability: 0.1
|
||||||
|
|
||||||
|
care_of:
|
||||||
|
care_of_after_attention:
|
||||||
|
after: attention
|
||||||
|
probability: 0.9
|
||||||
|
care_of_after_house:
|
||||||
|
after: house
|
||||||
|
probability: 0.1
|
||||||
|
|
||||||
|
subdivision:
|
||||||
|
subdivision_before_suburb:
|
||||||
|
before: suburb
|
||||||
|
probability: 1.0
|
||||||
|
|
||||||
# Overrides for languages (better for e.g. covering all French-speaking countries)
|
# Overrides for languages (better for e.g. covering all French-speaking countries)
|
||||||
languages:
|
languages:
|
||||||
en:
|
en:
|
||||||
insertions:
|
insertions:
|
||||||
|
building:
|
||||||
|
building_after_house:
|
||||||
|
after: house
|
||||||
|
probability: 0.6
|
||||||
|
building_after_road:
|
||||||
|
after: road
|
||||||
|
probability: 0.3
|
||||||
|
building_before_suburb:
|
||||||
|
before: suburb
|
||||||
|
probability: 0.1
|
||||||
|
conditional:
|
||||||
|
- component: subdivision
|
||||||
|
probabilities:
|
||||||
|
building_after_house:
|
||||||
|
after: house
|
||||||
|
probability: 0.6
|
||||||
|
building_after_road:
|
||||||
|
after: road
|
||||||
|
probability: 0.2
|
||||||
|
building_before_subdivision:
|
||||||
|
before: subdivision
|
||||||
|
probability: 0.2
|
||||||
|
entrance:
|
||||||
|
# e.g. 123 East 45th St, 6th Floor, NYC
|
||||||
|
entrance_after_road:
|
||||||
|
after: road
|
||||||
|
probability: 0.75
|
||||||
|
entrance_before_house:
|
||||||
|
before: house
|
||||||
|
probability: 0.1
|
||||||
|
# e.g. Da Vinci House, 1st Floor, 44 Saffron Hill, London
|
||||||
|
entrance_before_house_number:
|
||||||
|
before: house_number
|
||||||
|
probability: 0.15
|
||||||
|
conditional:
|
||||||
|
- component: building
|
||||||
|
probabilities:
|
||||||
|
# default: 0.8
|
||||||
|
entrance_after_building:
|
||||||
|
after: building
|
||||||
|
probability: 0.2
|
||||||
|
|
||||||
|
|
||||||
|
staircase:
|
||||||
|
# e.g. 123 East 45th St, Staircase C, NYC
|
||||||
|
staircase_after_road:
|
||||||
|
after: road
|
||||||
|
probability: 0.5
|
||||||
|
# e.g. Floor 1, Da Vinci House, 44 Saffron Hill, London
|
||||||
|
staircase_before_house:
|
||||||
|
before: house
|
||||||
|
probability: 0.1
|
||||||
|
# e.g. Da Vinci House, 1st Floor, 44 Saffron Hill, London
|
||||||
|
staircase_before_house_number:
|
||||||
|
before: house_number
|
||||||
|
probability: 0.4
|
||||||
|
conditional:
|
||||||
|
- component: entrance
|
||||||
|
probabilities:
|
||||||
|
# default: 0.1
|
||||||
|
staircase_after_entrance:
|
||||||
|
after: entrance
|
||||||
|
probability: 0.9
|
||||||
|
|
||||||
level:
|
level:
|
||||||
# e.g. 123 East 45th St, 6th Floor, NYC
|
# e.g. 123 East 45th St, 6th Floor, NYC
|
||||||
level_after_road:
|
level_after_road:
|
||||||
@@ -148,10 +212,24 @@ languages:
|
|||||||
before: house
|
before: house
|
||||||
probability: 0.25
|
probability: 0.25
|
||||||
# e.g. Da Vinci House, 1st Floor, 44 Saffron Hill, London
|
# e.g. Da Vinci House, 1st Floor, 44 Saffron Hill, London
|
||||||
level_before_road:
|
level_before_house_number:
|
||||||
before: road
|
before: house_number
|
||||||
probability: 0.25
|
probability: 0.25
|
||||||
|
|
||||||
|
conditional:
|
||||||
|
- component: staircase
|
||||||
|
probabilities:
|
||||||
|
# default: 0.4
|
||||||
|
level_after_staircase:
|
||||||
|
after: staircase
|
||||||
|
probability: 0.6
|
||||||
|
- component: entrance
|
||||||
|
probabilities:
|
||||||
|
# default: 0.4
|
||||||
|
level_after_entrance:
|
||||||
|
after: entrance
|
||||||
|
probability: 0.6
|
||||||
|
|
||||||
unit:
|
unit:
|
||||||
# e.g. Flat 18, Da Vinci House, 44 Saffron Hill, London
|
# e.g. Flat 18, Da Vinci House, 44 Saffron Hill, London
|
||||||
unit_before_house:
|
unit_before_house:
|
||||||
@@ -166,20 +244,87 @@ languages:
|
|||||||
# e.g. Da Vinci House, 44 Saffron Hill, Flat 18, London (not as common in UK)
|
# e.g. Da Vinci House, 44 Saffron Hill, Flat 18, London (not as common in UK)
|
||||||
unit_after_road:
|
unit_after_road:
|
||||||
after: road
|
after: road
|
||||||
probability: 0.1
|
probability: 0.2
|
||||||
|
|
||||||
# e.g. Floor 5, Apt 6
|
conditional:
|
||||||
unit_after_level:
|
- component: level
|
||||||
after: level
|
probabilities:
|
||||||
probability: 0.09
|
unit_before_house:
|
||||||
|
before: house
|
||||||
# e.g. Apt. 6, 5/F (less common)
|
probability: 0.1
|
||||||
unit_before_level:
|
# e.g. Da Vinci House, Flat 18, 44 Saffron Hill, London
|
||||||
before: level
|
unit_before_house_number:
|
||||||
probability: 0.01
|
before: house_number
|
||||||
|
probability: 0.1
|
||||||
|
# e.g. Floor 5, Apt 6
|
||||||
|
unit_after_level:
|
||||||
|
after: level
|
||||||
|
probability: 0.79
|
||||||
|
# e.g. Apt. 6, 5/F (less common)
|
||||||
|
unit_before_level:
|
||||||
|
before: level
|
||||||
|
probability: 0.01
|
||||||
|
|
||||||
es:
|
es:
|
||||||
insertions:
|
insertions:
|
||||||
|
building:
|
||||||
|
building_after_house_number:
|
||||||
|
after: house_number
|
||||||
|
probability: 0.8
|
||||||
|
building_after_house:
|
||||||
|
after: house
|
||||||
|
probability: 0.05
|
||||||
|
building_before_suburb:
|
||||||
|
before: suburb
|
||||||
|
probability: 0.15
|
||||||
|
conditional:
|
||||||
|
- component: subdivision
|
||||||
|
probabilities:
|
||||||
|
building_after_house_number:
|
||||||
|
after: house_number
|
||||||
|
probability: 0.8
|
||||||
|
building_before_subdivision:
|
||||||
|
before: subdivision
|
||||||
|
probability: 0.2
|
||||||
|
|
||||||
|
entrance:
|
||||||
|
# e.g. 123 East 45th St, 6th Floor, NYC
|
||||||
|
entrance_after_house_number:
|
||||||
|
after: house_number
|
||||||
|
probability: 0.8
|
||||||
|
entrance_before_house:
|
||||||
|
before: house
|
||||||
|
probability: 0.2
|
||||||
|
conditional:
|
||||||
|
- component: building
|
||||||
|
probabilities:
|
||||||
|
entrance_after_building:
|
||||||
|
after: building
|
||||||
|
probability: 0.9
|
||||||
|
|
||||||
|
staircase:
|
||||||
|
# e.g. 123 East 45th St, Staircase C, NYC
|
||||||
|
staircase_after_house_number:
|
||||||
|
after: house_number
|
||||||
|
probability: 0.8
|
||||||
|
# e.g. Floor 1, Da Vinci House, 44 Saffron Hill, London
|
||||||
|
staircase_before_house:
|
||||||
|
before: house
|
||||||
|
probability: 0.2
|
||||||
|
conditional:
|
||||||
|
- component: entrance
|
||||||
|
probabilities:
|
||||||
|
# default: 0.1
|
||||||
|
staircase_after_entrance:
|
||||||
|
after: entrance
|
||||||
|
probability: 0.9
|
||||||
|
- component: building
|
||||||
|
probabilities:
|
||||||
|
# default: 0.1
|
||||||
|
staircase_after_building:
|
||||||
|
after: building
|
||||||
|
probability: 0.9
|
||||||
|
|
||||||
level:
|
level:
|
||||||
# e.g. Calle Ruiz de Alarcón 23 piso 3
|
# e.g. Calle Ruiz de Alarcón 23 piso 3
|
||||||
level_after_house_number:
|
level_after_house_number:
|
||||||
@@ -194,21 +339,67 @@ languages:
|
|||||||
before: road
|
before: road
|
||||||
probability: 0.1
|
probability: 0.1
|
||||||
|
|
||||||
|
conditional:
|
||||||
|
- component: staircase
|
||||||
|
probabilities:
|
||||||
|
# default: 0.1
|
||||||
|
level_after_staircase:
|
||||||
|
after: staircase
|
||||||
|
probability: 0.9
|
||||||
|
- component: entrance
|
||||||
|
probabilities:
|
||||||
|
# default: 0.1
|
||||||
|
level_after_entrance:
|
||||||
|
after: entrance
|
||||||
|
probability: 0.9
|
||||||
|
- component: building
|
||||||
|
probabilities:
|
||||||
|
# default: 0.1
|
||||||
|
level_after_building:
|
||||||
|
after: building
|
||||||
|
probability: 0.9
|
||||||
|
|
||||||
unit:
|
unit:
|
||||||
unit_before_house:
|
unit_before_house:
|
||||||
before: house
|
before: house
|
||||||
probability: 0.05
|
probability: 0.2
|
||||||
unit_before_house_number:
|
unit_after_house_number:
|
||||||
before: house_number
|
after: house_number
|
||||||
probability: 0.05
|
probability: 0.7
|
||||||
# e.g. Piso 3 Dpto 12 (most common)
|
unit_before_road:
|
||||||
unit_after_level:
|
before: road
|
||||||
after: level
|
|
||||||
probability: 0.8
|
|
||||||
# e.g. Apto 6, 2o piso (less common)
|
|
||||||
unit_before_level:
|
|
||||||
before: level
|
|
||||||
probability: 0.1
|
probability: 0.1
|
||||||
|
conditional:
|
||||||
|
- component: level
|
||||||
|
probabilities:
|
||||||
|
# default: 0.1
|
||||||
|
# e.g. Piso 3 Dpto 12 (most common)
|
||||||
|
unit_after_level:
|
||||||
|
after: level
|
||||||
|
probability: 0.85
|
||||||
|
# e.g. Apto 6, 2o piso (less common)
|
||||||
|
unit_before_level:
|
||||||
|
before: level
|
||||||
|
probability: 0.05
|
||||||
|
- component: staircase
|
||||||
|
probabilities:
|
||||||
|
# default: 0.1
|
||||||
|
unit_after_staircase:
|
||||||
|
after: staircase
|
||||||
|
probability: 0.9
|
||||||
|
- component: entrance
|
||||||
|
probabilities:
|
||||||
|
# default: 0.1
|
||||||
|
unit_after_entrance:
|
||||||
|
after: entrance
|
||||||
|
probability: 0.9
|
||||||
|
- component: building
|
||||||
|
probabilities:
|
||||||
|
# default: 0.1
|
||||||
|
unit_after_building:
|
||||||
|
after: building
|
||||||
|
probability: 0.9
|
||||||
|
|
||||||
|
|
||||||
fr:
|
fr:
|
||||||
# libpostal issue #27
|
# libpostal issue #27
|
||||||
@@ -247,15 +438,15 @@ countries:
|
|||||||
# e.g. 123 East 45th St, 6th Floor, NYC
|
# e.g. 123 East 45th St, 6th Floor, NYC
|
||||||
level_after_road:
|
level_after_road:
|
||||||
after: road
|
after: road
|
||||||
probability: 0.75
|
probability: 0.875
|
||||||
# e.g. Floor 1, Da Vinci House, 44 Saffron Hill, London
|
# e.g. Floor 1, Da Vinci House, 44 Saffron Hill, London
|
||||||
level_before_house:
|
level_before_house:
|
||||||
before: house
|
before: house
|
||||||
probability: 0.125
|
probability: 0.005
|
||||||
# e.g. Da Vinci House, 1st Floor, 44 Saffron Hill, London
|
# e.g. Da Vinci House, 1st Floor, 44 Saffron Hill, London
|
||||||
level_before_road:
|
level_before_house_number:
|
||||||
before: road
|
before: house_number
|
||||||
probability: 0.125
|
probability: 0.12
|
||||||
|
|
||||||
unit:
|
unit:
|
||||||
# e.g. Flat 18, Da Vinci House, 44 Saffron Hill, London
|
# e.g. Flat 18, Da Vinci House, 44 Saffron Hill, London
|
||||||
|
|||||||
Reference in New Issue
Block a user