address_composer 1.0.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/main.yml +1 -1
  3. data/.gitmodules +1 -0
  4. data/.rubocop.yml +4 -20
  5. data/Gemfile.lock +57 -32
  6. data/README.md +26 -0
  7. data/address-formatting/.github/workflows/ci.yml +25 -0
  8. data/address-formatting/README.md +19 -13
  9. data/address-formatting/bin/coverage.pl +8 -2
  10. data/address-formatting/bin/run_tests.t +36 -10
  11. data/address-formatting/conf/abbreviations/ca.yaml +18 -1
  12. data/address-formatting/conf/abbreviations/cs.yaml +0 -3
  13. data/address-formatting/conf/abbreviations/da.yaml +1 -1
  14. data/address-formatting/conf/abbreviations/en.yaml +7 -1
  15. data/address-formatting/conf/abbreviations/es.yaml +21 -3
  16. data/address-formatting/conf/abbreviations/et.yaml +0 -3
  17. data/address-formatting/conf/abbreviations/eu.yaml +0 -1
  18. data/address-formatting/conf/abbreviations/fi.yaml +0 -3
  19. data/address-formatting/conf/abbreviations/fr.yaml +1 -1
  20. data/address-formatting/conf/abbreviations/gl.yaml +14 -0
  21. data/address-formatting/conf/abbreviations/it.yaml +1 -1
  22. data/address-formatting/conf/abbreviations/nl.yaml +17 -0
  23. data/address-formatting/conf/abbreviations/no.yaml +0 -4
  24. data/address-formatting/conf/abbreviations/pl.yaml +2 -2
  25. data/address-formatting/conf/abbreviations/pt.yaml +18 -0
  26. data/address-formatting/conf/abbreviations/ro.yaml +8 -2
  27. data/address-formatting/conf/abbreviations/sl.yaml +24 -0
  28. data/address-formatting/conf/abbreviations/{se.yaml → sv.yaml} +1 -5
  29. data/address-formatting/conf/abbreviations/tr.yaml +0 -4
  30. data/address-formatting/conf/abbreviations/{vn.yaml → vi.yaml} +1 -3
  31. data/address-formatting/conf/components.yaml +15 -4
  32. data/address-formatting/conf/countries/worldwide.yaml +401 -272
  33. data/address-formatting/conf/country2lang.yaml +33 -32
  34. data/address-formatting/conf/country_codes.yaml +216 -214
  35. data/address-formatting/conf/county_codes.yaml +19 -9
  36. data/address-formatting/conf/state_codes.yaml +91 -49
  37. data/address-formatting/cpanfile +10 -0
  38. data/address-formatting/testcases/abbreviations/de.yaml +27 -0
  39. data/address-formatting/testcases/abbreviations/en.yaml +15 -0
  40. data/address-formatting/testcases/abbreviations/fr.yaml +12 -0
  41. data/address-formatting/testcases/countries/al.yaml +17 -3
  42. data/address-formatting/testcases/countries/au.yaml +29 -3
  43. data/address-formatting/testcases/countries/be.yaml +17 -2
  44. data/address-formatting/testcases/countries/bg.yaml +1 -1
  45. data/address-formatting/testcases/countries/br.yaml +36 -2
  46. data/address-formatting/testcases/countries/ca.yaml +60 -18
  47. data/address-formatting/testcases/countries/cl.yaml +3 -2
  48. data/address-formatting/testcases/countries/cn.yaml +21 -8
  49. data/address-formatting/testcases/countries/co.yaml +19 -0
  50. data/address-formatting/testcases/countries/cu.yaml +24 -10
  51. data/address-formatting/testcases/countries/de.yaml +70 -13
  52. data/address-formatting/testcases/countries/eg.yaml +6 -6
  53. data/address-formatting/testcases/countries/eh.yaml +2 -2
  54. data/address-formatting/testcases/countries/es.yaml +12 -0
  55. data/address-formatting/testcases/countries/fr.yaml +30 -13
  56. data/address-formatting/testcases/countries/gb.yaml +63 -4
  57. data/address-formatting/testcases/countries/hu.yaml +3 -4
  58. data/address-formatting/testcases/countries/ie.yaml +43 -1
  59. data/address-formatting/testcases/countries/in.yaml +14 -1
  60. data/address-formatting/testcases/countries/ir.yaml +19 -8
  61. data/address-formatting/testcases/countries/it.yaml +30 -2
  62. data/address-formatting/testcases/countries/kg.yaml +1 -1
  63. data/address-formatting/testcases/countries/kr.yaml +13 -5
  64. data/address-formatting/testcases/countries/ml.yaml +9 -9
  65. data/address-formatting/testcases/countries/mu.yaml +17 -1
  66. data/address-formatting/testcases/countries/nz.yaml +11 -0
  67. data/address-formatting/testcases/countries/pa.yaml +17 -0
  68. data/address-formatting/testcases/countries/ph.yaml +64 -3
  69. data/address-formatting/testcases/countries/pt.yaml +17 -0
  70. data/address-formatting/testcases/countries/py.yaml +1 -1
  71. data/address-formatting/testcases/countries/ru.yaml +3 -3
  72. data/address-formatting/testcases/countries/sg.yaml +16 -0
  73. data/address-formatting/testcases/countries/sj.yaml +1 -1
  74. data/address-formatting/testcases/countries/sk.yaml +20 -2
  75. data/address-formatting/testcases/countries/sn.yaml +16 -0
  76. data/address-formatting/testcases/countries/tc.yaml +12 -0
  77. data/address-formatting/testcases/countries/th.yaml +1 -1
  78. data/address-formatting/testcases/countries/tk.yaml +1 -1
  79. data/address-formatting/testcases/countries/tw.yaml +7 -7
  80. data/address-formatting/testcases/countries/tz.yaml +1 -7
  81. data/address-formatting/testcases/countries/us.yaml +3 -5
  82. data/address-formatting/testcases/countries/uy.yaml +1 -1
  83. data/address-formatting/testcases/countries/vn.yaml +2 -1
  84. data/address-formatting/testcases/countries/xc.yaml +14 -0
  85. data/address-formatting/testcases/countries/xk.yaml +20 -0
  86. data/address_composer.gemspec +11 -9
  87. data/lib/address_composer/version.rb +1 -1
  88. data/lib/address_composer.rb +92 -14
  89. metadata +83 -34
  90. data/.travis.yml +0 -7
  91. data/address-formatting/.travis.yml +0 -12
@@ -5,7 +5,7 @@
5
5
  generic1: &generic1 |
6
6
  {{{attention}}}
7
7
  {{{house}}}
8
- {{{road}}} {{{house_number}}}
8
+ {{#first}} {{{road}}} || {{{place}}} || {{{hamlet}}} {{/first}} {{{house_number}}}
9
9
  {{{postcode}}} {{#first}} {{{postal_city}}} || {{{town}}} || {{{city}}} || {{{village}}} || {{{municipality}}} || {{{hamlet}}} || {{{county}}} || {{{state}}} {{/first}}
10
10
  {{{archipelago}}}
11
11
  {{{country}}}
@@ -13,7 +13,7 @@ generic1: &generic1 |
13
13
  # postcode after city
14
14
  generic2: &generic2 |
15
15
  {{{attention}}}
16
- {{#first}} {{{house}}}, {{{quarter}}} || {{{house}}} {{/first}}
16
+ {{{house}}}, {{{quarter}}}
17
17
  {{{house_number}}} {{{road}}}
18
18
  {{#first}} {{{village}}} || {{{town}}} || {{{city}}} || {{{municipality}}} || {{{hamlet}}} || {{{county}}} {{/first}} {{{postcode}}}
19
19
  {{#first}} {{{country}}} || {{{state}}} {{/first}}
@@ -23,7 +23,8 @@ generic3: &generic3 |
23
23
  {{{attention}}}
24
24
  {{{house}}}
25
25
  {{{house_number}}} {{{road}}}
26
- {{{postcode}}} {{#first}} {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{city}}} || {{{municipality}}} || {{{state}}} {{/first}}
26
+ {{{place}}}
27
+ {{{postcode}}} {{#first}} {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{city}}} || {{{municipality}}} || {{{state}}} {{/first}}
27
28
  {{{country}}}
28
29
 
29
30
  # postcode after state
@@ -40,7 +41,7 @@ generic5: &generic5 |
40
41
  {{{attention}}}
41
42
  {{{house}}}
42
43
  {{{house_number}}} {{{road}}}
43
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
44
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
44
45
  {{#first}} {{{state_district}}} || {{{state}}} {{/first}}
45
46
  {{{country}}}
46
47
 
@@ -49,24 +50,24 @@ generic6: &generic6 |
49
50
  {{{attention}}}
50
51
  {{{house}}}
51
52
  {{{house_number}}} {{{road}}}
52
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} {{/first}}
53
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} {{/first}}
53
54
  {{{county}}}
54
- {{{state}}}
55
+ {{{state}}}
55
56
  {{{country}}}
56
57
 
57
58
  # city, postcode
58
59
  generic7: &generic7 |
59
60
  {{{attention}}}
60
61
  {{{house}}}
61
- {{{road}}} {{{house_number}}}
62
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}, {{{postcode}}}
62
+ {{{road}}} {{{house_number}}}
63
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{state}}}{{/first}}, {{{postcode}}}
63
64
  {{{country}}}
64
65
 
65
66
  # postcode and county
66
67
  generic8: &generic8 |
67
68
  {{{attention}}}
68
69
  {{{house}}}
69
- {{{road}}}, {{{house_number}}}
70
+ {{{road}}} {{{house_number}}}
70
71
  {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} {{/first}} {{#first}} {{{county_code}}} || {{{county}}} {{/first}}
71
72
  {{{country}}}
72
73
 
@@ -81,7 +82,7 @@ generic9: &generic9 |
81
82
  generic10: &generic10 |
82
83
  {{{attention}}}
83
84
  {{{house}}}
84
- {{{road}}} {{{house_number}}}
85
+ {{{road}}}, {{{house_number}}}
85
86
  {{#first}} {{{suburb}}} || {{{city_district}}} {{/first}}
86
87
  {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
87
88
  {{{state}}}
@@ -111,7 +112,7 @@ generic13: &generic13 |
111
112
  {{{attention}}}
112
113
  {{{house}}}
113
114
  {{{house_number}}} {{{road}}}
114
- {{#first}} {{{suburb}}} || {{{city}}} || {{{town}}} || {{{state_district}}} || {{{village}}} || {{{hamlet}}} || {{{region}}} {{/first}} {{#first}} {{{state_code}}} || {{{state}}} {{/first}} {{{postcode}}}
115
+ {{#first}} {{{suburb}}} || {{{city_district}}} || {{{city}}} || {{{town}}} || {{{state_district}}} || {{{village}}} || {{{hamlet}}} || {{{region}}} {{/first}} {{#first}} {{{state_code}}} || {{{state}}} {{/first}} {{{postcode}}}
115
116
  {{{country}}}
116
117
 
117
118
  # postcode and state
@@ -136,15 +137,15 @@ generic16: &generic16 |
136
137
  {{{attention}}}
137
138
  {{{house}}}
138
139
  {{{house_number}}} {{{road}}}
139
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} || {{{county}}} || {{{state_district}}} || {{{state}}} {{/first}}
140
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} || {{{county}}} || {{{state_district}}} || {{{state}}} {{/first}}
140
141
  {{{country}}}
141
142
 
142
143
  # no postcode, no state, just city
143
144
  generic17: &generic17 |
144
145
  {{{attention}}}
145
146
  {{{house}}}
146
- {{{road}}} {{{house_number}}}
147
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} || {{{county}}} || {{{state_district}}} || {{{state}}} {{/first}}
147
+ {{{road}}} {{{house_number}}}
148
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} || {{{county}}} || {{{state_district}}} || {{{state}}} {{/first}}
148
149
  {{{country}}}
149
150
 
150
151
  # no postcode, just city comma after house number
@@ -152,7 +153,7 @@ generic18: &generic18 |
152
153
  {{{attention}}}
153
154
  {{{house}}}
154
155
  {{{house_number}}}, {{{road}}}
155
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} || {{{state}}} {{/first}}
156
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} || {{{state}}} {{/first}}
156
157
  {{{country}}}
157
158
 
158
159
  # suburb and postcode after city
@@ -161,25 +162,25 @@ generic19: &generic19 |
161
162
  {{{house}}}
162
163
  {{{road}}} {{{house_number}}}
163
164
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
164
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}} {{{postcode}}}
165
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}} {{{postcode}}}
165
166
  {{{country}}}
166
167
 
167
168
  # suburb and postcode after city
168
169
  generic20: &generic20 |
169
170
  {{{attention}}}
170
171
  {{{house}}}
171
- {{{house_number}}} {{{road}}}
172
+ {{{house_number}}} {{{road}}}
172
173
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
173
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}} {{{postcode}}}
174
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}} {{{postcode}}}
174
175
  {{{country}}}
175
176
 
176
177
  # suburb and city, no postcode
177
178
  generic21: &generic21 |
178
179
  {{{attention}}}
179
180
  {{{house}}}
180
- {{{road}}} {{{house_number}}}
181
+ {{{road}}} {{{house_number}}}
181
182
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
182
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{state}}} {{/first}}
183
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{state}}} {{/first}}
183
184
  {{{country}}}
184
185
 
185
186
  # comma after housenumber, postcode before city
@@ -193,27 +194,28 @@ generic22: &generic22 |
193
194
  # postcode on own line
194
195
  generic23: &generic23 |
195
196
  {{{attention}}}
196
- {{house}}
197
+ {{{house}}}
197
198
  {{{house_number}}} {{{road}}}
198
- {{quarter}}
199
+ {{{quarter}}}
199
200
  {{#first}} {{{village}}} || {{{town}}} || {{{city}}} || {{{municipality}}} || {{{hamlet}}} || {{{county}}} {{/first}}
200
201
  {{{postcode}}}
201
202
  {{#first}} {{{country}}} || {{{state}}} {{/first}}
202
203
 
203
-
204
204
  fallback1: &fallback1 |
205
205
  {{{attention}}}
206
206
  {{{house}}}
207
207
  {{{road}}} {{{house_number}}}
208
+ {{{place}}}
208
209
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} || {{{island}}} {{/first}}
209
210
  {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} {{/first}}
210
- {{#first}} {{{county}}} || {{{state_district}}} || {{{state}}} || {{{region}}} {{/first}}
211
+ {{#first}} {{{county}}} || {{{state_district}}} || {{{state}}} || {{{region}}} || {{{island}}}, {{{archipelago}}} {{/first}}
211
212
  {{{country}}}
212
213
 
213
214
  fallback2: &fallback2 |
214
215
  {{{attention}}}
215
216
  {{{house}}}
216
217
  {{{road}}} {{{house_number}}}
218
+ {{{place}}}
217
219
  {{#first}} {{{suburb}}} || {{{village}}} || {{{hamlet}}} {{/first}}
218
220
  {{#first}} {{{city}}} || {{{town}}} || {{{municipality}}} || {{{county}}} || {{{island}}} || {{{state_district}}} {{/first}}, {{#first}} {{{state}}} || {{{state_code}}} {{/first}}
219
221
  {{{country}}}
@@ -222,8 +224,10 @@ fallback3: &fallback3 |
222
224
  {{{attention}}}
223
225
  {{{house}}}
224
226
  {{{road}}} {{{house_number}}}
227
+ {{{place}}}
225
228
  {{#first}} {{{suburb}}} || {{{island}}} {{/first}}
226
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} {{/first}}
229
+ {{#first}} {{{village}}} || {{{hamlet}}} || {{{municipality}}} {{/first}}
230
+ {{#first}} {{{town}}} || {{{city}}}{{/first}}
227
231
  {{{county}}}
228
232
  {{#first}} {{{state}}} || {{{state_code}}} {{/first}}
229
233
  {{{country}}}
@@ -232,15 +236,16 @@ fallback4: &fallback4 |
232
236
  {{{attention}}}
233
237
  {{{house}}}
234
238
  {{{road}}} {{{house_number}}}
239
+ {{{place}}}
235
240
  {{{suburb}}}
236
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} {{/first}}
241
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} || {{{county}}} {{/first}}
237
242
  {{#first}} {{{state}}} || {{{county}}} {{/first}}
238
243
  {{{country}}}
239
244
 
240
245
  default:
241
246
  address_template: *generic1
242
247
  fallback_template: *fallback1
243
-
248
+
244
249
  # country / territory specific mappings
245
250
  # please keep in alpha order by country code
246
251
  #
@@ -257,7 +262,7 @@ AE:
257
262
  {{{house}}}
258
263
  {{{house_number}}} {{{road}}}
259
264
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
260
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
265
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
261
266
  {{#first}} {{{state_district}}} || {{{state}}} {{/first}}
262
267
  {{{country}}}
263
268
 
@@ -274,7 +279,7 @@ AI:
274
279
  address_template: |
275
280
  {{{attention}}}
276
281
  {{{house}}}
277
- {{{road}}} {{{house_number}}}
282
+ {{{road}}} {{{house_number}}}
278
283
  {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
279
284
  {{{postcode}}} {{{country}}}
280
285
 
@@ -283,8 +288,8 @@ AL:
283
288
  address_template: |
284
289
  {{{attention}}}
285
290
  {{{house}}}
286
- {{{road}}} {{{house_number}}}
287
- {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} || {{{village}}} || {{{hamlet}}} {{/first}}
291
+ {{{road}}} {{{house_number}}}
292
+ {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{city_district}}} || {{{municipality}}} || {{{state_district}}} || {{{village}}} || {{{hamlet}}} {{/first}}
288
293
  {{{country}}}
289
294
  postformat_replace:
290
295
  # fix the postcode to add - after numbers
@@ -295,8 +300,8 @@ AM:
295
300
  address_template: |
296
301
  {{{attention}}}
297
302
  {{{house}}}
298
- {{{house_number}}} {{{road}}}
299
- {{{postcode}}}
303
+ {{{house_number}}} {{{road}}}
304
+ {{{postcode}}}
300
305
  {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
301
306
  {{#first}} {{{state_district}}} || {{{state}}} {{/first}}
302
307
  {{{country}}}
@@ -308,13 +313,16 @@ AO:
308
313
  # Antarctica
309
314
  AQ:
310
315
  address_template: |
311
- {{{attention}}}
316
+ {{{house}}}
317
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
318
+ {{#first}} {{{country}}} || {{{continent}}} {{/first}}
319
+ fallback_template: |
312
320
  {{{house}}}
313
321
  {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
314
322
  {{#first}} {{{country}}} || {{{continent}}} {{/first}}
315
323
 
316
324
  # Argentina
317
- AR:
325
+ AR:
318
326
  address_template: *generic9
319
327
  replace:
320
328
  - ["^Autonomous City of ",""]
@@ -323,21 +331,21 @@ AR:
323
331
  - ["\n(\\w\\d{4})(\\w{3}) ","\n$1 $2 "]
324
332
 
325
333
  # American Samoa
326
- AS:
334
+ AS:
327
335
  use_country: US
328
336
  change_country: United States of America
329
337
  add_component: state=American Samoa
330
338
 
331
339
  # Austria
332
- AT:
340
+ AT:
333
341
  address_template: *generic1
334
342
 
335
343
  # Australia
336
- AU:
344
+ AU:
337
345
  address_template: *generic13
338
346
 
339
347
  # Aruba
340
- AW:
348
+ AW:
341
349
  address_template: *generic17
342
350
 
343
351
  # Åland Islands, part of Finnland
@@ -381,9 +389,9 @@ BE:
381
389
  BF:
382
390
  address_template: *generic6
383
391
 
384
- # Bulgaria
392
+ # Bulgaria - https://en.wikipedia.org/wiki/Address#Bulgaria
385
393
  BG:
386
- address_template: *generic9
394
+ address_template: *generic19
387
395
 
388
396
  # Bahrain
389
397
  BH:
@@ -400,7 +408,7 @@ BJ:
400
408
  # Saint Barthélemy - same as FR
401
409
  BL:
402
410
  use_country: FR
403
- change_country: Saint-Barthélemy, France
411
+ change_country: Saint-Barthélemy, France
404
412
 
405
413
  # Bermuda
406
414
  BM:
@@ -411,9 +419,9 @@ BN:
411
419
  address_template: |
412
420
  {{{attention}}}
413
421
  {{{house}}}
414
- {{{house_number}}}, {{{road}}}
415
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} {{/first}}
416
- {{#first}} {{{county}}} || {{{state_district}}} || {{{state}}} {{/first}} {{{postcode}}}
422
+ {{{house_number}}}, {{{road}}}
423
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} {{/first}}
424
+ {{#first}} {{{county}}} || {{{state_district}}} || {{{state}}} {{/first}} {{{postcode}}}
417
425
  {{{country}}}
418
426
 
419
427
 
@@ -433,9 +441,9 @@ BR:
433
441
  address_template: |
434
442
  {{{attention}}}
435
443
  {{{house}}}
436
- {{{road}}} {{{house_number}}}
437
- {{#first}} {{{suburb}}} || {{{city_district}}} {{/first}}
438
- {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} || {{{village}}} || {{{hamlet}}} {{/first}} - {{#first}} {{{state_code}}} || {{{state}}} {{/first}}
444
+ {{{road}}} {{{house_number}}}{{#first}}, {{{quarter}}}{{/first}}
445
+ {{#first}} {{{suburb}}} || {{{city_district}}} || {{{village}}} || {{{hamlet}}}{{/first}}
446
+ {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} {{/first}} - {{#first}} {{{state_code}}} || {{{state}}} {{/first}}
439
447
  {{{postcode}}}
440
448
  {{{country}}}
441
449
  postformat_replace:
@@ -446,9 +454,9 @@ BS:
446
454
  address_template: |
447
455
  {{{attention}}}
448
456
  {{{house}}}
449
- {{{road}}} {{{house_number}}}
450
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} {{/first}}
451
- {{{county}}}
457
+ {{{road}}} {{{house_number}}}
458
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} {{/first}}
459
+ {{{county}}}
452
460
  {{{country}}}
453
461
 
454
462
  # Bhutan
@@ -458,7 +466,7 @@ BT:
458
466
  {{{house}}}
459
467
  {{{road}}} {{{house_number}}}, {{{house}}}
460
468
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
461
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{state}}} {{/first}} {{{postcode}}}
469
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{state}}} {{/first}} {{{postcode}}}
462
470
  {{{country}}}
463
471
 
464
472
  # Bouvet Island
@@ -471,9 +479,9 @@ BW:
471
479
  address_template: |
472
480
  {{{attention}}}
473
481
  {{{house}}}
474
- {{{road}}} {{{house_number}}}
482
+ {{{road}}} {{{house_number}}}
475
483
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
476
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
484
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
477
485
  {{{country}}}
478
486
 
479
487
  # Belarus
@@ -484,13 +492,31 @@ BY:
484
492
  BZ:
485
493
  address_template: *generic16
486
494
 
487
- # Canada
488
- CA:
495
+ # Canada - https://en.wikipedia.org/wiki/Address#Canada
496
+ CA:
489
497
  address_template: |
490
498
  {{{attention}}}
491
499
  {{{house}}}
492
500
  {{#first}} {{{house_number}}} {{{road}}} || {{{suburb}}} {{/first}}
493
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{state_district}}} {{/first}}, {{#first}} {{{state_code}}} || {{{state}}} {{/first}} {{{postcode}}}
501
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{county}}} || {{{state_district}}} {{/first}}, {{#first}} {{{state_code}}} || {{{state}}} {{/first}} {{{postcode}}}
502
+ {{{country}}}
503
+ fallback_template: |
504
+ {{{attention}}}
505
+ {{{house}}}
506
+ {{#first}} {{{house_number}}} {{{road}}} || {{{suburb}}} {{/first}}
507
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{county}}} || {{{state_district}}} || {{{region}}}{{/first}}, {{#first}} {{{state}}} || {{{state_code}}} {{/first}} {{{postcode}}}
508
+ {{{country}}}
509
+ postformat_replace:
510
+ # fix the postcode to make it \w\w\w \w\w\w
511
+ - [" ([A-Za-z]{2}) ([A-Za-z]\\d[A-Za-z])(\\d[A-Za-z]\\d)\n"," $1 $2 $3\n"]
512
+
513
+ #Canada - English
514
+ CA_en:
515
+ address_template: |
516
+ {{{attention}}}
517
+ {{{house}}}
518
+ {{#first}} {{{house_number}}} {{{road}}} || {{{suburb}}} {{/first}}
519
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{county}}} || {{{state_district}}} {{/first}}, {{#first}} {{{state_code}}} || {{{state}}} {{/first}} {{{postcode}}}
494
520
  {{{country}}}
495
521
  fallback_template: |
496
522
  {{{attention}}}
@@ -500,8 +526,19 @@ CA:
500
526
  {{{country}}}
501
527
  postformat_replace:
502
528
  # fix the postcode to make it \w\w\w \w\w\w
503
- - [" (\\w{2}) (\\w{3})(\\w{3})\n"," $1 $2 $3\n"]
529
+ - [" ([A-Za-z]{2}) ([A-Za-z]\\d[A-Za-z])(\\d[A-Za-z]\\d)\n"," $1 $2 $3\n"]
504
530
 
531
+ #Canada - French Quebec
532
+ CA_fr:
533
+ address_template: |
534
+ {{{attention}}}
535
+ {{{house}}}
536
+ {{#first}} {{{house_number}}}, {{{road}}} || {{{suburb}}} {{/first}}
537
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{county}}} || {{{state_district}}} {{/first}} {{#first}} ({{{state_code}}}) || {{{state}}} {{/first}} {{{postcode}}}
538
+ {{{country}}}
539
+ postformat_replace:
540
+ # fix the postcode to make it \w\w\w \w\w\w
541
+ - [" ([A-Za-z]{2}) ([A-Za-z]\\d[A-Za-z])(\\d[A-Za-z]\\d)\n"," $1 $2 $3\n"]
505
542
 
506
543
  # Cocos (Keeling) Islands
507
544
  CC:
@@ -521,61 +558,74 @@ CG:
521
558
  address_template: *generic18
522
559
 
523
560
  # Switzerland
524
- CH:
525
- address_template: *generic1
561
+ CH:
562
+ address_template: |
563
+ {{{attention}}}
564
+ {{{house}}}
565
+ {{{road}}} {{{house_number}}}
566
+ {{{postcode}}} {{#first}} {{{postal_city}}} || {{{town}}} || {{{city}}} || {{{municipality}}} || {{{village}}} || {{{hamlet}}} || {{{county}}} || {{{state}}} {{/first}}
567
+ {{{country}}}
568
+ replace:
569
+ - ["Verwaltungskreis",""]
570
+ - ["Verwaltungsregion",""]
571
+ - [" administrative district",""]
572
+ - [" administrative region",""]
526
573
 
527
574
  # Côte d'Ivoire
528
- CI:
575
+ CI:
529
576
  address_template: *generic16
530
577
 
531
578
  # Cook Islands
532
- CK:
579
+ CK:
533
580
  address_template: *generic16
534
581
 
535
- # Chile
536
- CL:
537
- address_template: *generic1
538
- postformat_replace:
539
- # fix the postcode to make it \d\d\d \d\d\d\d
540
- - ["\n(\\d{3})(\\d{4}) ","\n$1 $2 "]
582
+ # Chile - https://en.wikipedia.org/wiki/Address#Chile
583
+ CL:
584
+ address_template: |
585
+ {{{attention}}}
586
+ {{{house}}}
587
+ {{{road}}} {{{house_number}}}
588
+ {{{postcode}}} {{#first}} {{{postal_city}}} || {{{town}}} || {{{city}}} || {{{village}}} || {{{municipality}}} || {{{hamlet}}} || {{{county}}} || {{{state}}} {{/first}}
589
+ {{{region}}}
590
+ {{{country}}}
541
591
 
542
592
  # Cameroon
543
- CM:
593
+ CM:
544
594
  address_template: *generic17
545
595
 
546
596
  # China
547
597
  CN:
548
598
  address_template: |
549
- {{{attention}}}
550
- {{{house}}}
551
- {{{house_number}}} {{{road}}}
552
- {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
599
+ {{{postcode}}} {{{country}}}
600
+ {{#first}} {{{state_code}}} || {{{state}}} || {{{state_district}}} || {{{region}}}{{/first}}
553
601
  {{{county}}}
554
- {{{postcode}}} {{#first}} {{{state_code}}} || {{{state}}} || {{{city}}} || {{{town}}} || {{{municipality}}} || {{{state_district}}} || {{{region}}} || {{{village}}}|| {{{hamlet}}} {{/first}}
555
- {{{country}}}
602
+ {{#first}}{{{city}}} || {{{town}}} || {{{municipality}}}|| {{{village}}}|| {{{hamlet}}}{{/first}}
603
+ {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
604
+ {{{road}}} {{{house_number}}}
605
+ {{{house}}}
606
+ {{{attention}}}
556
607
 
557
608
  # China - English
558
609
  CN_en:
559
610
  address_template: |
560
611
  {{{attention}}}
561
612
  {{{house}}}
562
- {{{house_number}}} {{{road}}}
613
+ {{{house_number}}} {{{road}}}
563
614
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
564
615
  {{{county}}}
565
- {{{postcode}}} {{#first}} {{{state_code}}} || {{{state}}} || {{{city}}} || {{{town}}} || {{{municipality}}} || {{{state_district}}} || {{{region}}} || {{{village}}} || {{{hamlet}}} {{/first}}
566
- {{{country}}}
616
+ {{#first}}{{{city}}} || {{{town}}} || {{{municipality}}}|| {{{village}}}|| {{{hamlet}}}{{/first}}
617
+ {{#first}} {{{state_code}}} || {{{state}}} || {{{state_district}}} || {{{region}}}{{/first}}
618
+ {{{country}}} {{{postcode}}}
567
619
 
568
- # China - Chinese
620
+ # China - Chinese Simplified
569
621
  CN_zh:
570
622
  address_template: |
571
- {{{country}}}
572
- {{{postcode}}}
573
- {{#first}} {{{state_code}}} || {{{state}}} || {{{region}}} {{/first}}
574
- {{#first}} {{{state_district}}} || {{{county}}} {{/first}}
575
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} {{/first}}
623
+ {{{postcode}}} {{{country}}}
624
+ {{#first}} {{{state_code}}} || {{{state}}} || {{{state_district}}} || {{{region}}}{{/first}}
625
+ {{{county}}}
626
+ {{#first}}{{{city}}} || {{{town}}} || {{{municipality}}}|| {{{village}}}|| {{{hamlet}}}{{/first}}
576
627
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
577
- {{{road}}}
578
- {{{house_number}}}
628
+ {{{road}}} {{{house_number}}}
579
629
  {{{house}}}
580
630
  {{{attention}}}
581
631
 
@@ -589,10 +639,9 @@ CO:
589
639
  {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} || {{{village}}} || {{{hamlet}}} {{/first}}, {{#first}} {{{state_code}}} || {{{state}}} {{/first}}
590
640
  {{{country}}}
591
641
  postformat_replace:
592
- - ["Localidad "," "]
593
- - ["Bogota, Bogota","Bogota"]
594
- - ["Bogota, Bogotá Distrito Capital","Bogota"]
595
- - ["Bogotá, Bogotá Distrito Capital","Bogotá"]
642
+ - ["Localidad "," "]
643
+ - ["(Bogot[áa]),? (Distrito Capital|Capital District)",$1]
644
+ - ["(Bogot[áa]), Bogot[áa]","$1"]
596
645
 
597
646
  # Costa Rica
598
647
  CR:
@@ -615,50 +664,59 @@ CV:
615
664
  - ["\n(\\d{4}) ([^,]*)\n","\n$1-$2\n"]
616
665
 
617
666
  # Curaçao
618
- CW:
667
+ CW:
619
668
  address_template: *generic17
620
669
 
621
670
  # Christmas Island - same as Australia
622
- CX:
671
+ CX:
623
672
  use_country: AU
624
673
  add_component: state=Christmas Island
625
674
  change_country: Australia
626
675
 
627
676
  # Cyprus
628
- CY:
677
+ CY:
629
678
  address_template: *generic1
630
679
 
631
680
  # Czech Republic
632
- CZ:
681
+ CZ:
633
682
  address_template: *generic1
683
+ replace:
684
+ - ["^Capital City of ",""]
634
685
  postformat_replace:
635
- # fix the postcode to make it \d\d\d \d\d
686
+ # fix the postcode to make it \d\d\d \d\d
636
687
  - ["\n(\\d{3})(\\d{2}) ","\n$1 $2 "]
637
688
 
638
689
  # Germany
639
690
  DE:
640
- address_template: *generic1
691
+ address_template: |
692
+ {{{attention}}}
693
+ {{{house}}}
694
+ {{#first}} {{{road}}} || {{{place}}} || {{{hamlet}}} {{/first}} {{{house_number}}}
695
+ {{{postcode}}} {{#first}} {{{village}}} {{{postal_city}}} || {{{town}}} || {{{city}}} || {{{municipality}}} || {{{hamlet}}} || {{{county}}} || {{{state}}} {{/first}}
696
+ {{{archipelago}}}
697
+ {{{country}}}
641
698
  fallback_template: |
642
699
  {{{attention}}}
643
700
  {{{house}}}
644
- {{{road}}} {{{house_number}}}
701
+ {{#first}} {{{road}}} || {{{place}}} || {{{hamlet}}} {{/first}} {{{house_number}}}
645
702
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
646
- {{#first}} {{{town}}} || {{{city}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} || {{{county}}} {{/first}}
703
+ {{#first}} {{{village}}} || {{{town}}} || {{{city}}} || {{{hamlet}}} || {{{municipality}}} || {{{county}}} {{/first}}
647
704
  {{#first}} {{{state}}} || {{{state_district}}} {{/first}}
648
705
  {{{country}}}
649
-
706
+
650
707
  replace:
651
708
  - ["^Stadtteil ",""]
652
709
  - ["^Stadtbezirk (\\d+)",""]
653
- - ["^Ortsbeirat (\\d+) :",""]
710
+ - ["^Ortsbeirat (\\d+) :",""]
654
711
  - ["^Gemeinde ",""]
655
- - ["^Gemeindeverwaltungsverband ",""]
712
+ - ["^Gemeindeverwaltungsverband ",""]
656
713
  - ["^Landkreis ",""]
657
714
  - ["^Kreis ",""]
658
715
  - ["^Grenze ",""]
659
716
  - ["^Free State of ",""]
660
717
  - ["^Freistaat ",""]
661
718
  - ["^Regierungsbezirk ",""]
719
+ - ["^Stadtgebiet ",""]
662
720
  - ["^Gemeindefreies Gebiet ",""]
663
721
  - ["city=Alt-Berlin","Berlin"]
664
722
  postformat_replace:
@@ -675,6 +733,8 @@ DJ:
675
733
  # Denmark
676
734
  DK:
677
735
  address_template: *generic1
736
+ replace:
737
+ - ["^Capital Region of ",""]
678
738
 
679
739
  # Dominica
680
740
  DM:
@@ -685,16 +745,14 @@ DO:
685
745
  address_template: |
686
746
  {{{attention}}}
687
747
  {{{house}}}
688
- {{{road}}} {{{house_number}}}
748
+ {{{road}}} {{{house_number}}}
689
749
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
690
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}, {{{state}}}
691
- {{{postcode}}}
750
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}, {{{state}}}
751
+ {{{postcode}}}
692
752
  {{{country}}}
693
753
  postformat_replace:
694
754
  - [", Distrito Nacional",", DN"]
695
755
 
696
-
697
-
698
756
  # Algeria
699
757
  DZ:
700
758
  address_template: *generic3
@@ -716,8 +774,8 @@ EG:
716
774
  {{{house}}}
717
775
  {{{house_number}}} {{{road}}}
718
776
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
719
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
720
- {{{postcode}}}
777
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
778
+ {{{postcode}}}
721
779
  {{{country}}}
722
780
 
723
781
  # Estonia
@@ -737,31 +795,36 @@ ES:
737
795
  address_template: *generic15
738
796
  fallback_template: *fallback4
739
797
 
798
+ replace:
799
+ - ["Autonomous Community of the",""]
800
+ - ["Autonomous Community of",""]
801
+ - ["^Community of ",""]
802
+
740
803
  # Ethiopia
741
804
  ET:
742
805
  address_template: *generic1
743
806
 
744
807
  # Finnland
745
- FI:
808
+ FI:
746
809
  address_template: *generic1
747
810
 
748
811
  # Fiji
749
- FJ:
812
+ FJ:
750
813
  address_template: *generic16
751
814
 
752
815
  # Falkland Islands
753
- FK:
816
+ FK:
754
817
  use_country: GB
755
818
  change_country: Falkland Islands, United Kingdom
756
819
 
757
820
  # Federated States of Micronesia
758
- FM:
821
+ FM:
759
822
  use_country: US
760
823
  change_country: United States of America
761
824
  add_component: state=Micronesia
762
825
 
763
- # Faroe Islands
764
- FO:
826
+ # Faroe Islands
827
+ FO:
765
828
  address_template: *generic1
766
829
  postformat_replace:
767
830
  - ["Territorial waters of Faroe Islands","Faroe Islands"]
@@ -776,15 +839,16 @@ FR:
776
839
  - ["Grande Terre et récifs d'Entrecasteaux",""]
777
840
  - ["France, Nouvelle-Calédonie","Nouvelle-Calédonie, France"]
778
841
  - ["\\(eaux territoriales\\)",""]
842
+ - ["state= \\(France\\)$",""]
779
843
  - ["Paris (\\d+)(\\w+) Arrondissement$","Paris"]
780
-
844
+
781
845
 
782
846
  # Gabon
783
847
  GA:
784
848
  address_template: |
785
849
  {{{attention}}}
786
850
  {{{house}}}
787
- {{{house_number}}} {{{road}}}
851
+ {{{house_number}}} {{{road}}}
788
852
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} || {{{village}}} || {{{hamlet}}} {{/first}}
789
853
  {{#first}} {{{city}}} || {{{town}}} || {{{municipality}}} || {{{county}}} || {{{state_district}}} || {{{state}}} {{/first}}
790
854
  {{{country}}}
@@ -793,14 +857,14 @@ GB:
793
857
  address_template: *generic23
794
858
  fallback_template: *fallback3
795
859
  replace:
860
+ - ["village= CP$",""]
796
861
  - ["^Borough of ",""]
797
862
  - ["^County( of)? ",""]
798
863
  - ["^Parish of ",""]
799
- - ["^Central ",""]
800
864
  - ["^Greater London","London"]
801
865
  - ["^London Borough of ",""]
802
866
  - ["Royal Borough of ",""]
803
- - ["County Borough of ",""]
867
+ - ["County Borough of ",""]
804
868
  postformat_replace:
805
869
  - ["London, London","London"]
806
870
  - ["London, Greater London","London"]
@@ -820,7 +884,7 @@ GE:
820
884
  # French Guiana - same as FR
821
885
  GF:
822
886
  use_country: FR
823
- change_country: France
887
+ change_country: France
824
888
 
825
889
  # Guernsey - same format as UK, but not part of UK
826
890
  GG:
@@ -832,7 +896,7 @@ GH:
832
896
  address_template: *generic16
833
897
 
834
898
  # Gibraltar
835
- GI:
899
+ GI:
836
900
  address_template: *generic16
837
901
 
838
902
  # Greenland
@@ -850,15 +914,18 @@ GN:
850
914
  # Guadeloupe - same as FR
851
915
  GP:
852
916
  use_country: FR
853
- change_country: Guadeloupe, France
917
+ change_country: Guadeloupe, France
854
918
 
855
919
  # Equatorial Guinea
856
- GQ:
920
+ GQ:
857
921
  address_template: *generic17
858
922
 
859
923
  # Greece
860
924
  GR:
861
925
  address_template: *generic1
926
+ replace:
927
+ - ["Municipal Unit of ",""]
928
+ - ["Regional Unit of ",""]
862
929
  postformat_replace:
863
930
  # fix the postcode to make it \d\d\d \d\d
864
931
  - ["\n(\\d{3})(\\d{2}) ","\n$1 $2 "]
@@ -882,7 +949,7 @@ GT:
882
949
  - ["\n -","\n"]
883
950
 
884
951
  # Guam
885
- GU:
952
+ GU:
886
953
  use_country: US
887
954
  change_country: United States of America
888
955
  add_component: state=Guam
@@ -900,7 +967,7 @@ HK:
900
967
  address_template: |
901
968
  {{{attention}}}
902
969
  {{{house}}}
903
- {{{house_number}}} {{{road}}}
970
+ {{{house_number}}} {{{road}}}
904
971
  {{{state_district}}}
905
972
  {{#first}} {{{state}}} || {{{country}}} {{/first}}
906
973
 
@@ -909,7 +976,7 @@ HK_en:
909
976
  address_template: |
910
977
  {{{attention}}}
911
978
  {{{house}}}
912
- {{{house_number}}} {{{road}}}
979
+ {{{house_number}}} {{{road}}}
913
980
  {{{state_district}}}
914
981
  {{{state}}}
915
982
  {{{country}}}
@@ -927,17 +994,17 @@ HK_zh:
927
994
 
928
995
 
929
996
  # Heard Island and McDonald Islands - same as Australia
930
- HM:
997
+ HM:
931
998
  use_country: AU
932
999
  change_country: Australia
933
1000
  add_component: state=Heard Island and McDonald Islands
934
1001
 
935
1002
  # Honduras
936
- HN:
1003
+ HN:
937
1004
  address_template: *generic1
938
1005
 
939
1006
  # Croatia
940
- HR:
1007
+ HR:
941
1008
  address_template: *generic1
942
1009
 
943
1010
  # Haiti
@@ -947,13 +1014,12 @@ HT:
947
1014
  - [" Commune de"," "]
948
1015
 
949
1016
  # Hungary
1017
+ # https://e-nyelv.hu/2014-09-19/lakcim/
950
1018
  HU:
951
1019
  address_template: |
952
1020
  {{{attention}}}
953
- {{{house}}}
954
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
955
- {{{road}}} {{{house_number}}}
956
- {{{postcode}}}
1021
+ {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
1022
+ {{{road}}} {{{house_number}}}.
957
1023
  {{{country}}}
958
1024
 
959
1025
  # Indonesia
@@ -970,7 +1036,7 @@ ID:
970
1036
 
971
1037
  # Ireland
972
1038
  # https://en.wikipedia.org/wiki/Postal_addresses_in_the_Republic_of_Ireland
973
- IE:
1039
+ IE:
974
1040
  address_template: |
975
1041
  {{{attention}}}
976
1042
  {{{house}}}
@@ -978,22 +1044,28 @@ IE:
978
1044
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
979
1045
  {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} {{/first}}
980
1046
  {{{county}}}
1047
+ {{{postcode}}}
981
1048
  {{{country}}}
982
1049
  replace:
983
1050
  - [" City$",""]
984
1051
  - ["The Municipal District of ",""]
985
1052
  - ["The Metropolitan District of ",""]
986
1053
  - ["Municipal District",""]
987
- - ["Electoral Division",""]
1054
+ - ["Electoral Division",""]
988
1055
  postformat_replace:
989
1056
  - ["Dublin\nCounty Dublin","Dublin"]
1057
+ - ["Dublin\nLeinster","Dublin"]
990
1058
  - ["Galway\nCounty Galway","Galway"]
991
- - ["Kilkenny\nCounty Kilkenny","Kilkenny"]
1059
+ - ["Kilkenny\nCounty Kilkenny","Kilkenny"]
992
1060
  - ["Limerick\nCounty Limerick","Limerick"]
993
- - ["Tipperary\nCounty Tipperary","Tipperary"]
994
-
1061
+ - ["Tipperary\nCounty Tipperary","Tipperary"]
1062
+ # fix eircode formatting
1063
+ #- ["\n(\\d{4})(\\w{2}) ","\n$1 $2 "]
1064
+ - ["\n(([AC-FHKNPRTV-Y][0-9]{2}|D6W))[ -]?([0-9AC-FHKNPRTV-Y]{4})", "\n$1 $3"]
1065
+
1066
+
995
1067
  # Israel
996
- IL:
1068
+ IL:
997
1069
  address_template: *generic1
998
1070
 
999
1071
  # Isle of Man
@@ -1004,6 +1076,9 @@ IM:
1004
1076
  # http://en.wikipedia.org/wiki/Address_%28geography%29#India
1005
1077
  IN:
1006
1078
  address_template: *generic12
1079
+ postformat_replace:
1080
+ # deal with - but no postcode
1081
+ - [" -\n","\n"]
1007
1082
 
1008
1083
  # British Indian Ocean Territory - same as UK
1009
1084
  IO:
@@ -1011,12 +1086,12 @@ IO:
1011
1086
  change_country: British Indian Ocean Territory, United Kingdom
1012
1087
 
1013
1088
  # Iraq
1014
- IQ:
1089
+ IQ:
1015
1090
  address_template: |
1016
1091
  {{{attention}}}
1017
1092
  {{{house}}}
1018
1093
  {{{house_number}}} {{#first}} {{{city_district}}} || {{{neighbourhood}}} || {{{suburb}}} {{/first}}
1019
- {{{road}}}
1094
+ {{{road}}}
1020
1095
  {{#first}} {{{city}}} || {{{town}}} || {{{state}}} || {{{village}}} || {{{hamlet}}} {{/first}}
1021
1096
  {{{postcode}}}
1022
1097
  {{{country}}}
@@ -1030,7 +1105,7 @@ IR:
1030
1105
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
1031
1106
  {{{road}}}
1032
1107
  {{{house_number}}}
1033
- {{#first}} {{{province}}} || {{{state}}} {{/first}}
1108
+ {{#first}}{{{province}}} || {{{state}}} || {{{state_district}}}{{/first}}
1034
1109
  {{{postcode}}}
1035
1110
  {{{country}}}
1036
1111
 
@@ -1042,13 +1117,15 @@ IR_en:
1042
1117
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
1043
1118
  {{{road}}}
1044
1119
  {{{house_number}}}
1045
- {{#first}} {{{province}}} || {{{state}}} {{/first}}
1120
+ {{#first}}{{{state}}} || {{{state_district}}}{{/first}}
1046
1121
  {{{postcode}}}
1047
1122
  {{{country}}}
1048
1123
 
1049
1124
  IR_fa:
1050
1125
  address_template: |
1051
1126
  {{{country}}}
1127
+ {{{state}}}
1128
+ {{{state_district}}}
1052
1129
  {{#first}} {{{state}}} || {{{province}}} {{/first}}
1053
1130
  {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
1054
1131
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
@@ -1059,15 +1136,16 @@ IR_fa:
1059
1136
  {{{postcode}}}
1060
1137
 
1061
1138
  # Iceland
1062
- IS:
1139
+ IS:
1063
1140
  address_template: *generic1
1064
1141
 
1065
1142
  # Italy
1066
- IT:
1143
+ IT:
1067
1144
  address_template: *generic8
1068
1145
  replace:
1069
1146
  - ["Città metropolitana di ",""]
1070
1147
  - ["Metropolitan City of ",""]
1148
+ - ["^Provincia di ",""]
1071
1149
  postformat_replace:
1072
1150
  - ["Vatican City\nVatican City$","\nVatican City"]
1073
1151
  - ["Città del Vaticano\nCittà del Vaticano$","Città del Vaticano\n"]
@@ -1149,7 +1227,7 @@ KH:
1149
1227
  address_template: |
1150
1228
  {{{attention}}}
1151
1229
  {{{house}}}
1152
- {{{house_number}}} {{{road}}}
1230
+ {{{house_number}}} {{{road}}}
1153
1231
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
1154
1232
  {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}} {{{postcode}}}
1155
1233
  {{{country}}}
@@ -1169,46 +1247,43 @@ KM:
1169
1247
  {{{country}}}
1170
1248
 
1171
1249
  # Saint Kitts and Nevis
1172
- KN:
1250
+ KN:
1173
1251
  address_template: |
1174
1252
  {{{attention}}}
1175
1253
  {{{house}}}
1176
- {{{house_number}}} {{{road}}}
1254
+ {{{house_number}}} {{{road}}}
1177
1255
  {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}, {{#first}} {{{state}}} || {{{island}}} {{/first}}
1178
1256
  {{{country}}}
1179
1257
 
1180
1258
  # Democratic People's Republic of Korea / North Korea
1181
- KP:
1259
+ KP:
1182
1260
  address_template: *generic21
1183
1261
 
1184
- # Republic of Korea / South Korea
1185
- KR:
1262
+ # Republic of Korea / South Korea -- https://en.wikipedia.org/wiki/Address#South_Korea
1263
+ KR:
1186
1264
  address_template: |
1187
- {{{attention}}}
1188
- {{{house}}}
1189
- {{{house_number}}} {{{road}}}
1190
- {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}, {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}, {{#first}} {{{state}}} {{/first}} {{{postcode}}}
1191
1265
  {{{country}}}
1266
+ {{{state}}}
1267
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}, {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}, {{{road}}} {{{house_number}}}
1268
+ {{{attention}}}
1269
+ {{{postcode}}}
1192
1270
 
1193
1271
  # South Korea - English
1194
1272
  KR_en:
1195
1273
  address_template: |
1196
1274
  {{{attention}}}
1197
1275
  {{{house}}}
1198
- {{{house_number}}} {{{road}}}
1199
- {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}, {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}, {{#first}} {{{state}}} {{/first}} {{{postcode}}}
1276
+ {{{house_number}}} {{{road}}}
1277
+ {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}, {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}} {{{postcode}}}
1278
+ {{{state}}}
1200
1279
  {{{country}}}
1201
1280
 
1202
1281
  # South Korea - Korean
1203
1282
  KR_ko:
1204
1283
  address_template: |
1205
1284
  {{{country}}}
1206
- {{#first}} {{{state}}} {{/first}}
1207
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
1208
- {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
1209
- {{{road}}}
1210
- {{{house_number}}}
1211
- {{{house}}}
1285
+ {{{state}}}
1286
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}, {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}, {{{road}}} {{{house_number}}}
1212
1287
  {{{attention}}}
1213
1288
  {{{postcode}}}
1214
1289
 
@@ -1219,7 +1294,7 @@ KW:
1219
1294
  {{{house}}}
1220
1295
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
1221
1296
 
1222
- {{{road}}}
1297
+ {{{road}}}
1223
1298
  {{{house_number}}} {{{house}}}
1224
1299
  {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
1225
1300
  {{{country}}}
@@ -1233,11 +1308,11 @@ KZ:
1233
1308
  address_template: *generic11
1234
1309
 
1235
1310
  # Laos
1236
- LA:
1311
+ LA:
1237
1312
  address_template: *generic22
1238
1313
 
1239
1314
  # Lebanon
1240
- LB:
1315
+ LB:
1241
1316
  address_template: *generic2
1242
1317
  postformat_replace:
1243
1318
  # fix the postcode to make it nonbreaking space
@@ -1248,7 +1323,7 @@ LC:
1248
1323
  address_template: *generic17
1249
1324
 
1250
1325
  # Liechtenstein, same as Switzerland
1251
- LI:
1326
+ LI:
1252
1327
  use_country: CH
1253
1328
 
1254
1329
  # Sri Lanka
@@ -1303,7 +1378,7 @@ ME:
1303
1378
  # Collectivité de Saint-Martin
1304
1379
  MF:
1305
1380
  use_country: FR
1306
- change_country: France
1381
+ change_country: France
1307
1382
 
1308
1383
  # Marshall Islands
1309
1384
  MH:
@@ -1315,9 +1390,9 @@ MG:
1315
1390
  address_template: |
1316
1391
  {{{attention}}}
1317
1392
  {{{house}}}
1318
- {{{house_number}}} {{{road}}}
1393
+ {{{house_number}}} {{{road}}}
1319
1394
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
1320
- {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
1395
+ {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
1321
1396
  {{{country}}}
1322
1397
 
1323
1398
  # North Macedonia
@@ -1330,11 +1405,11 @@ ML:
1330
1405
 
1331
1406
  # Myanmar (Burma)
1332
1407
  MM:
1333
- address_template: |
1408
+ address_template: |
1334
1409
  {{{attention}}}
1335
1410
  {{{house}}}
1336
- {{{house_number}}} {{{road}}}
1337
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{state}}} {{/first}}, {{{postcode}}}
1411
+ {{{house_number}}} {{{road}}}
1412
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{state}}} {{/first}}, {{{postcode}}}
1338
1413
  {{{country}}}
1339
1414
 
1340
1415
 
@@ -1343,12 +1418,12 @@ MN:
1343
1418
  address_template: |
1344
1419
  {{{attention}}}
1345
1420
  {{{house}}}
1346
- {{{city_district}}}
1421
+ {{{city_district}}}
1347
1422
  {{#first}} {{{suburb}}} || {{{neighbourhood}}} {{/first}}
1348
- {{{road}}}
1349
- {{{house_number}}}
1423
+ {{{road}}}
1424
+ {{{house_number}}}
1350
1425
  {{{postcode}}}
1351
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
1426
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
1352
1427
  {{{country}}}
1353
1428
 
1354
1429
  # Macau
@@ -1375,7 +1450,7 @@ MO_zh:
1375
1450
  {{{country}}}
1376
1451
  {{#first}} {{{suburb}}} || {{{village}}} || {{{hamlet}}} || {{{state_district}}} {{/first}}
1377
1452
  {{{road}}}
1378
- {{{house_number}}}
1453
+ {{{house_number}}}
1379
1454
  {{{house}}}
1380
1455
  {{{attention}}}
1381
1456
 
@@ -1394,15 +1469,15 @@ MT:
1394
1469
  address_template: |
1395
1470
  {{{attention}}}
1396
1471
  {{{house}}}
1397
- {{{house_number}}} {{{road}}}
1398
- {{#first}} {{{city}}} || {{{town}}} || {{{suburb}}} || {{{village}}} || {{{hamlet}}} {{/first}}
1472
+ {{{house_number}}} {{{road}}}
1473
+ {{#first}} {{{city}}} || {{{town}}} || {{{suburb}}} || {{{village}}} || {{{hamlet}}} {{/first}}
1399
1474
  {{{postcode}}}
1400
1475
  {{{country}}}
1401
1476
 
1402
1477
  # Martinique - overseas territory of France (FR)
1403
1478
  MQ:
1404
1479
  use_country: FR
1405
- change_country: Martinique, France
1480
+ change_country: Martinique, France
1406
1481
 
1407
1482
  # Mauritania
1408
1483
  MR:
@@ -1410,7 +1485,13 @@ MR:
1410
1485
 
1411
1486
  # Mauritius
1412
1487
  MU:
1413
- address_template: *generic18
1488
+ address_template: |
1489
+ {{{attention}}}
1490
+ {{{house}}}
1491
+ {{{house_number}}}, {{{road}}}
1492
+ {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
1493
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{state}}} {{/first}} {{{postcode}}}
1494
+ {{{country}}}
1414
1495
 
1415
1496
  # Maldives
1416
1497
  MV:
@@ -1447,32 +1528,32 @@ MZ:
1447
1528
  fallback_template: *fallback4
1448
1529
 
1449
1530
  # Namibia
1450
- NA:
1531
+ NA:
1451
1532
  address_template: *generic2
1452
1533
 
1453
1534
  # New Caledonia, special collectivity of France
1454
1535
  NC:
1455
1536
  use_country: FR
1456
- change_country: Nouvelle-Calédonie, France
1537
+ change_country: Nouvelle-Calédonie, France
1457
1538
 
1458
1539
  # Niger
1459
- NE:
1540
+ NE:
1460
1541
  address_template: |
1461
1542
  {{{attention}}}
1462
1543
  {{{house}}}
1463
- {{{house_number}}}
1544
+ {{{house_number}}}
1464
1545
  {{{road}}}
1465
1546
  {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
1466
1547
  {{{country}}}
1467
1548
 
1468
1549
  # Norfolk Island - same as Australia
1469
- NF:
1550
+ NF:
1470
1551
  use_country: AU
1471
1552
  add_component: state=Norfolk Island
1472
1553
  change_country: Australia
1473
1554
 
1474
1555
  # Nigeria
1475
- NG:
1556
+ NG:
1476
1557
  address_template: |
1477
1558
  {{{attention}}}
1478
1559
  {{{house}}}
@@ -1500,13 +1581,13 @@ NL:
1500
1581
  address_template: *generic1
1501
1582
 
1502
1583
  # Nepal
1503
- NP:
1584
+ NP:
1504
1585
  address_template: |
1505
1586
  {{{attention}}}
1506
1587
  {{{house}}}
1507
- {{{road}}} {{{house_number}}}
1588
+ {{{road}}} {{{house_number}}}
1508
1589
  {{#first}} {{{suburb}}} || {{{neighbourhood}}} || {{{city}}} {{/first}}
1509
- {{#first}} {{{municipality}}} || {{{county}}} || {{{state_district}}} || {{{state}}} {{/first}} {{{postcode}}}
1590
+ {{#first}} {{{municipality}}} || {{{county}}} || {{{state_district}}} || {{{state}}} {{/first}} {{{postcode}}}
1510
1591
  {{{country}}}
1511
1592
 
1512
1593
  # Nauru
@@ -1520,13 +1601,15 @@ NU:
1520
1601
  # New Zealand
1521
1602
  NZ:
1522
1603
  address_template: *generic20
1604
+ postformat_replace:
1605
+ - ["Wellington\nWellington City","Wellington"]
1523
1606
 
1524
1607
  # Oman
1525
1608
  OM:
1526
1609
  address_template: |
1527
1610
  {{{attention}}}
1528
1611
  {{{house}}}
1529
- {{{house_number}}} {{{road}}}
1612
+ {{{house_number}}} {{{road}}}
1530
1613
  {{{postcode}}}
1531
1614
  {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} || {{{village}}} || {{{hamlet}}} {{/first}}
1532
1615
  {{{state}}}
@@ -1544,8 +1627,8 @@ PA:
1544
1627
  {{{state}}}
1545
1628
  {{{country}}}
1546
1629
  replace:
1547
- - ["city=Panama","Panama City"]
1548
- - ["city=Panamá","Ciudad de Panamá"]
1630
+ - ["city=Panama$","Panama City"]
1631
+ - ["city=Panamá$","Ciudad de Panamá"]
1549
1632
 
1550
1633
  # Peru
1551
1634
  PE:
@@ -1554,7 +1637,7 @@ PE:
1554
1637
  # French Polynesia - same as FR
1555
1638
  PF:
1556
1639
  use_country: FR
1557
- change_country: Polynésie française, France
1640
+ change_country: Polynésie française, France
1558
1641
  replace:
1559
1642
  - ["Polynésie française, Îles du Vent \\(eaux territoriales\\)","Polynésie française"]
1560
1643
 
@@ -1564,18 +1647,17 @@ PG:
1564
1647
  address_template: |
1565
1648
  {{{attention}}}
1566
1649
  {{{house}}}
1567
- {{{house_number}}} {{{road}}}
1568
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}} {{{postcode}}} {{{state}}}
1650
+ {{{house_number}}} {{{road}}}
1651
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}} {{{postcode}}} {{{state}}}
1569
1652
  {{{country}}}
1570
1653
 
1571
- # Philippines
1654
+ # Philippines - https://en.wikipedia.org/wiki/Address#Philippines
1572
1655
  PH:
1573
1656
  address_template: |
1574
1657
  {{{attention}}}
1575
1658
  {{{house}}}
1576
- {{{house_number}}} {{{road}}}
1577
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{suburb}}} || {{{state_district}}} {{/first}}
1578
- {{{postcode}}} {{{state}}}
1659
+ {{{house_number}}} {{{road}}}, {{#first}}{{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}}{{/first}}, {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{suburb}}} || {{{state_district}}} {{/first}}
1660
+ {{{postcode}}} {{#first}} {{{municipality}}} || {{{region}}} || {{{state}}} || {{/first}}
1579
1661
  {{{country}}}
1580
1662
 
1581
1663
  # Pakistan
@@ -1585,28 +1667,28 @@ PK:
1585
1667
  {{{house}}}
1586
1668
  {{{house_number}}} {{{road}}}
1587
1669
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
1588
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{state}}} {{/first}} {{{postcode}}}
1670
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{state}}} {{/first}} {{{postcode}}}
1589
1671
  {{{country}}}
1590
1672
 
1591
1673
  # Poland
1592
1674
  PL:
1593
1675
  address_template: *generic1
1594
1676
  postformat_replace:
1595
- # fix the postcode to make it \d\d-\d\d\d
1677
+ # fix the postcode to make it \d\d-\d\d\d
1596
1678
  - ["\n(\\d{2})(\\w{3}) ","\n$1-$2 "]
1597
1679
 
1598
1680
 
1599
1681
  # Saint Pierre and Miquelon - same as FR
1600
1682
  PM:
1601
1683
  use_country: FR
1602
- change_country: Saint-Pierre-et-Miquelon, France
1684
+ change_country: Saint-Pierre-et-Miquelon, France
1603
1685
 
1604
1686
  # Pitcairn Islands
1605
1687
  PN:
1606
1688
  address_template: |
1607
1689
  {{{attention}}}
1608
1690
  {{{house}}}
1609
- {{#first}} {{{city}}} || {{{town}}} || {{{island}}} {{/first}}
1691
+ {{#first}} {{{city}}} || {{{town}}} || {{{island}}} {{/first}}
1610
1692
  {{{country}}}
1611
1693
 
1612
1694
  # Puerto Rico, same as USA
@@ -1622,13 +1704,17 @@ PS:
1622
1704
  # Portugal
1623
1705
  PT:
1624
1706
  address_template: *generic1
1707
+ postformat_replace:
1708
+ # fix the postcode to add - after numbers
1709
+ - ["\n(\\d{4})(\\d{3}) ","\n$1-$2 "]
1710
+
1625
1711
 
1626
1712
  # Palau
1627
- PW:
1713
+ PW:
1628
1714
  address_template: *generic1
1629
1715
 
1630
1716
  # Parguay
1631
- PY:
1717
+ PY:
1632
1718
  address_template: *generic1
1633
1719
 
1634
1720
  # Qatar
@@ -1638,11 +1724,11 @@ QA:
1638
1724
  # Réunion - same as FR
1639
1725
  RE:
1640
1726
  use_country: FR
1641
- change_country: La Réunion, France
1727
+ change_country: La Réunion, France
1642
1728
 
1643
1729
 
1644
1730
  # Romania
1645
- RO:
1731
+ RO:
1646
1732
  address_template: *generic1
1647
1733
 
1648
1734
  # Serbia
@@ -1655,7 +1741,7 @@ RU:
1655
1741
  fallback_template: |
1656
1742
  {{{attention}}}
1657
1743
  {{{house}}}
1658
- {{{road}}} {{{house_number}}}
1744
+ {{{road}}}, {{{house_number}}}
1659
1745
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} || {{{island}}} || {{{village}}} || {{{hamlet}}} {{/first}}
1660
1746
  {{#first}} {{{city}}} || {{{town}}} || {{{municipality}}} {{/first}}
1661
1747
  {{#first}} {{{county}}} || {{{state_district}}} || {{{state}}} {{/first}}
@@ -1675,25 +1761,25 @@ SA:
1675
1761
  {{{country}}}
1676
1762
 
1677
1763
  # Solomon Islands
1678
- SB:
1764
+ SB:
1679
1765
  address_template: *generic17
1680
1766
 
1681
1767
  # Seychelles
1682
- SC:
1768
+ SC:
1683
1769
  address_template: |
1684
1770
  {{{attention}}}
1685
1771
  {{{house}}}
1686
- {{{house_number}}} {{{road}}}
1687
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{island}}} {{/first}}
1772
+ {{{house_number}}} {{{road}}}
1773
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{island}}} {{/first}}
1688
1774
  {{{island}}}
1689
1775
  {{{country}}}
1690
1776
 
1691
1777
  # Sudan
1692
- SD:
1778
+ SD:
1693
1779
  address_template: *generic1
1694
1780
 
1695
1781
  # Sweden
1696
- SE:
1782
+ SE:
1697
1783
  address_template: *generic1
1698
1784
  postformat_replace:
1699
1785
  # fix the postcode to make it \d\d\d \d\d
@@ -1703,10 +1789,10 @@ SE:
1703
1789
  SG:
1704
1790
  address_template: |
1705
1791
  {{{attention}}}
1706
- {{#first}} {{{house}}}, {{{quarter}}} || {{{house}}} {{/first}}
1792
+ {{{house}}}, {{{quarter}}}
1707
1793
  {{{house_number}}} {{{road}}}, {{{residential}}}
1708
- {{#first}} {{{village}}} || {{{town}}} || {{{city}}} || {{{municipality}}} || {{{hamlet}}} || {{{country}}} || {{{county}}} {{/first}} {{{postcode}}}
1709
- {{#first}} {{{country}}} || {{{state}}} {{/first}}
1794
+ {{#first}} {{{country}}} || {{{town}}} || {{{city}}} || {{{municipality}}} || {{{hamlet}}} || {{{village}}} || {{{county}}} {{/first}} {{{postcode}}}
1795
+ {{{country}}}
1710
1796
 
1711
1797
  # Saint Helena, Ascension and Tristan da Cunha - same as UK
1712
1798
  SH:
@@ -1714,7 +1800,7 @@ SH:
1714
1800
  change_country: $state, United Kingdom
1715
1801
 
1716
1802
  # Slovenia
1717
- SI:
1803
+ SI:
1718
1804
  address_template: *generic1
1719
1805
 
1720
1806
  # Svalbard and Jan Mayen - same as Norway
@@ -1723,25 +1809,38 @@ SJ:
1723
1809
  change_country: Norway
1724
1810
 
1725
1811
  # Slovakia
1726
- SK:
1727
- address_template: *generic1
1812
+ SK:
1813
+ address_template: |
1814
+ {{{attention}}}
1815
+ {{{house}}}
1816
+ {{{road}}} {{{house_number}}}
1817
+ {{{postcode}}} {{#first}} {{{postal_city}}} || {{{city}}} || {{{town}}} || {{{village}}} || {{{municipality}}} || {{{city_district}}} || {{{hamlet}}} || {{{county}}} || {{{state}}} {{/first}}
1818
+ {{{country}}}
1728
1819
  replace:
1729
1820
  - ["^District of ",""]
1821
+ - ["^Region of ",""]
1822
+ postformat_replace:
1823
+ # fix the postcode to make it \d\d\d \d\d
1824
+ - ["\n(\\d{3})(\\d{2}) ","\n$1 $2 "]
1730
1825
 
1731
1826
  # Sierra Leone
1732
1827
  SL:
1733
1828
  address_template: *generic16
1734
1829
 
1735
1830
  # San Marino - same as IT
1736
- SM:
1831
+ SM:
1737
1832
  use_country: IT
1738
1833
 
1739
1834
  # Senegal
1740
1835
  SN:
1741
1836
  address_template: *generic3
1837
+ replace:
1838
+ - ["^Commune de ",""]
1839
+ - ["^Arrondissement de ",""]
1840
+ - ["^Département de ",""]
1742
1841
 
1743
1842
  # Somalia
1744
- SO:
1843
+ SO:
1745
1844
  address_template: *generic21
1746
1845
 
1747
1846
  # Suriname
@@ -1749,7 +1848,7 @@ SR:
1749
1848
  address_template: *generic21
1750
1849
 
1751
1850
  # South Sudan
1752
- SS:
1851
+ SS:
1753
1852
  address_template: *generic17
1754
1853
 
1755
1854
  # São Tomé and Príncipe
@@ -1757,69 +1856,76 @@ ST:
1757
1856
  address_template: *generic17
1758
1857
 
1759
1858
  # El Salvador
1760
- SV:
1859
+ SV:
1761
1860
  address_template: |
1762
1861
  {{{attention}}}
1763
1862
  {{{house}}}
1764
- {{{road}}} {{{house_number}}}
1765
- {{{postcode}}} - {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
1766
- {{{state}}}
1863
+ {{{road}}} {{{house_number}}}
1864
+ {{{postcode}}} - {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
1865
+ {{{state}}}
1767
1866
  {{{country}}}
1768
1867
  postformat_replace:
1769
1868
  - ["\n- ","\n "]
1770
1869
 
1771
1870
  # Sint Maarten
1772
- SX:
1871
+ SX:
1773
1872
  address_template: *generic17
1774
1873
 
1775
1874
  # Syria
1776
- SY:
1875
+ SY:
1777
1876
  address_template: |
1778
1877
  {{{attention}}}
1779
1878
  {{{house}}}
1780
1879
  {{{road}}}, {{{house_number}}}
1781
1880
  {{#first}} {{{village}}} || {{{hamlet}}} || {{{city_district}}} || {{{neighbourhood}}} || {{{suburb}}} {{/first}}
1782
1881
  {{{postcode}}} {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} || {{{state}}} {{/first}}
1783
-
1882
+
1784
1883
  {{{country}}}
1785
1884
 
1786
1885
 
1787
1886
  # Swaziland
1788
- SZ:
1887
+ SZ:
1789
1888
  address_template: |
1790
1889
  {{{attention}}}
1791
1890
  {{{house}}}
1792
1891
  {{{road}}} {{{house_number}}}
1793
1892
  {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{state}}} {{/first}}
1794
- {{{postcode}}}
1893
+ {{{postcode}}}
1795
1894
  {{{country}}}
1796
1895
 
1797
- # Turks and Caicos Islands - same as UK
1896
+ # Turks and Caicos Islands
1798
1897
  TC:
1799
- use_country: GB
1898
+ address_template: *generic23
1899
+ fallback_template: |
1900
+ {{{attention}}}
1901
+ {{{house_number}}} {{{road}}}
1902
+ {{{quarter}}}
1903
+ {{#first}} {{{village}}} || {{{town}}} || {{{city}}} || {{{municipality}}} || {{{hamlet}}} || {{{county}}} {{/first}}
1904
+ {{{island}}}
1905
+ {{{country}}}
1800
1906
 
1801
1907
  # Chad
1802
- TD:
1908
+ TD:
1803
1909
  address_template: *generic21
1804
1910
 
1805
1911
  # French Southern and Antarctic Lands
1806
1912
  TF:
1807
1913
  use_country: FR
1808
- change_country: Terres australes et antarctiques françaises, France
1914
+ change_country: Terres australes et antarctiques françaises, France
1809
1915
 
1810
1916
  # Togo
1811
1917
  TG:
1812
1918
  address_template: *generic18
1813
1919
 
1814
- # Thailand
1920
+ # Thailand -- https://en.wikipedia.org/wiki/Thai_addressing_system
1815
1921
  TH:
1816
1922
  address_template: |
1817
1923
  {{{attention}}}
1818
1924
  {{{house}}}
1819
1925
  {{{house_number}}} {{#first}} {{{village}}} || {{{hamlet}}} {{/first}}
1820
- {{{road}}}
1926
+ {{{road}}}
1821
1927
  {{#first}} {{{neighbourhood}}} || {{{city}}} || {{{town}}} {{/first}}, {{#first}} {{{suburb}}} || {{{city_district}}} || {{{state_district}}} {{/first}}
1822
- {{{state}}} {{{postcode}}}
1928
+ {{{state}}} {{{postcode}}}
1823
1929
  {{{country}}}
1824
1930
 
1825
1931
  # Tajikistan
@@ -1832,11 +1938,11 @@ TK:
1832
1938
  change_country: Tokelau, New Zealand
1833
1939
 
1834
1940
  # Timor-Leste/East Timor
1835
- TL:
1941
+ TL:
1836
1942
  address_template: *generic17
1837
1943
 
1838
1944
  # Turkmenistan
1839
- TM:
1945
+ TM:
1840
1946
  address_template: *generic22
1841
1947
 
1842
1948
  # Tunisia
@@ -1844,11 +1950,11 @@ TN:
1844
1950
  address_template: *generic3
1845
1951
 
1846
1952
  # Tonga
1847
- TO:
1953
+ TO:
1848
1954
  address_template: *generic16
1849
1955
 
1850
1956
  # Turkey
1851
- TR:
1957
+ TR:
1852
1958
  address_template: *generic1
1853
1959
 
1854
1960
  # Trinidad and Tobago
@@ -1862,7 +1968,7 @@ TT:
1862
1968
  {{{country}}}
1863
1969
 
1864
1970
  # Tuvalu
1865
- TV:
1971
+ TV:
1866
1972
  address_template: |
1867
1973
  {{{attention}}}
1868
1974
  {{{house}}}
@@ -1871,22 +1977,28 @@ TV:
1871
1977
  {{#first}} {{{county}}} || {{{state_district}}} || {{{state}}} || {{{island}}} {{/first}}
1872
1978
  {{{country}}}
1873
1979
 
1874
- # Taiwan
1875
- TW:
1876
- address_template: *generic20
1980
+ # Taiwan -- https://en.wikipedia.org/wiki/Address#Taiwan
1981
+ TW:
1982
+ address_template: |
1983
+ {{{country}}}
1984
+ {{{postcode}}}
1985
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} {{/first}} {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} {{{road}}} {{{house_number}}}
1986
+ {{{house}}}
1987
+ {{{attention}}}
1877
1988
 
1878
1989
  TW_en:
1879
- address_template: *generic20
1990
+ address_template: |
1991
+ {{{attention}}}
1992
+ {{{house}}}
1993
+ {{{house_number}}}, {{{road}}}
1994
+ {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}, {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}} {{{postcode}}}
1995
+ {{{country}}}
1880
1996
 
1881
1997
  TW_zh:
1882
1998
  address_template: |
1883
1999
  {{{country}}}
1884
2000
  {{{postcode}}}
1885
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} {{/first}}
1886
- {{{city_district}}}
1887
- {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
1888
- {{{road}}}
1889
- {{{house_number}}}
2001
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} {{/first}} {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}} {{{road}}} {{{house_number}}}
1890
2002
  {{{house}}}
1891
2003
  {{{attention}}}
1892
2004
 
@@ -1897,15 +2009,16 @@ TZ:
1897
2009
  postformat_replace:
1898
2010
  - ["Dar es Salaam\nDar es Salaam","Dar es Salaam"]
1899
2011
 
1900
- # Ukraine
2012
+ # Ukraine -- https://en.wikipedia.org/wiki/Address#Ukraine
1901
2013
  UA:
1902
2014
  address_template: |
1903
2015
  {{{attention}}}
1904
2016
  {{{house}}}
1905
2017
  {{{road}}}, {{{house_number}}}
1906
2018
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{state_district}}} {{/first}}
1907
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} || {{{state}}} {{/first}}
1908
- {{{postcode}}}
2019
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{municipality}}} {{/first}}
2020
+ {{#first}} {{{region}}} || {{{state}}} {{/first}}
2021
+ {{{postcode}}}
1909
2022
  {{{country}}}
1910
2023
 
1911
2024
  # Uganda
@@ -1920,7 +2033,7 @@ UM:
1920
2033
  add_component: state=US Minor Outlying Islands
1921
2034
 
1922
2035
  # USA
1923
- US:
2036
+ US:
1924
2037
  address_template: *generic4
1925
2038
  fallback_template: *fallback2
1926
2039
  replace:
@@ -1939,21 +2052,21 @@ UZ:
1939
2052
  {{{attention}}}
1940
2053
  {{{house}}}
1941
2054
  {{{road}}} {{{house_number}}}
1942
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
1943
- {{#first}} {{{state}}} || {{{state_district}}} {{/first}}
2055
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}
2056
+ {{#first}} {{{state}}} || {{{state_district}}} {{/first}}
1944
2057
  {{{country}}}
1945
2058
  {{{postcode}}}
1946
2059
 
1947
2060
  # Uruguay
1948
- UY:
2061
+ UY:
1949
2062
  address_template: *generic1
1950
2063
 
1951
2064
  # Vatican City - same as IT
1952
- VA:
2065
+ VA:
1953
2066
  use_country: IT
1954
2067
 
1955
2068
  # Saint Vincent and the Grenadines
1956
- VC:
2069
+ VC:
1957
2070
  address_template: *generic17
1958
2071
 
1959
2072
  # Venezuela
@@ -1970,23 +2083,24 @@ VG:
1970
2083
  address_template: |
1971
2084
  {{{attention}}}
1972
2085
  {{{house}}}
1973
- {{{house_number}}} {{{road}}}
2086
+ {{{house_number}}} {{{road}}}
1974
2087
  {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} {{/first}}, {{{island}}}
1975
2088
  {{{country}}}, {{{postcode}}}
1976
2089
 
1977
2090
  # US Virgin Islands, same as USA
1978
- VI:
2091
+ VI:
1979
2092
  use_country: US
1980
2093
  change_country: United States of America
1981
2094
  add_component: state=US Virgin Islands
1982
2095
 
1983
- # Vietnam
2096
+ # Vietnam -- https://en.wikipedia.org/wiki/Address#Vietnam
1984
2097
  VN:
1985
2098
  address_template: |
1986
2099
  {{{attention}}}
1987
2100
  {{{house}}}
1988
- {{{house_number}}}, {{{road}}}
1989
- {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}, {{#first}} {{{city}}} || {{{town}}} || {{{state_district}}} || {{{village}}} || {{{hamlet}}} {{/first}}
2101
+ {{{house_number}}} {{{road}}}
2102
+ {{#first}} {{{suburb}}} || {{{city_district}}} || {{{neighbourhood}}} {{/first}}
2103
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{state_district}}} {{/first}}
1990
2104
  {{{state}}} {{{postcode}}}
1991
2105
  {{{country}}}
1992
2106
 
@@ -1997,12 +2111,27 @@ VU:
1997
2111
  # Wallis and Futuna, same as France
1998
2112
  WF:
1999
2113
  use_country: FR
2000
- change_country: Wallis-et-Futuna, France
2114
+ change_country: Wallis-et-Futuna, France
2001
2115
 
2002
2116
  # Samoa
2003
2117
  WS:
2004
2118
  address_template: *generic17
2005
2119
 
2120
+ # Sovereign Base Areas of Akrotiri and Dhekelia
2121
+ # not an official ISO code
2122
+ XC:
2123
+ address_template: *generic6
2124
+
2125
+ # Kosovo
2126
+ # not an official ISO code
2127
+ XK:
2128
+ address_template: |
2129
+ {{{attention}}}
2130
+ {{{house}}}
2131
+ {{{house_number}}}, {{{road}}}
2132
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{state}}} {{/first}} {{{postcode}}}
2133
+ {{{country}}}
2134
+
2006
2135
  # Yemen
2007
2136
  YE:
2008
2137
  address_template: *generic18
@@ -2010,16 +2139,16 @@ YE:
2010
2139
  # Mayotte - same as FR
2011
2140
  YT:
2012
2141
  use_country: FR
2013
- change_country: Mayotte, France
2142
+ change_country: Mayotte, France
2014
2143
 
2015
2144
  # South Africa
2016
- ZA:
2145
+ ZA:
2017
2146
  address_template: |
2018
2147
  {{{attention}}}
2019
2148
  {{{house}}}
2020
2149
  {{{house_number}}} {{{road}}}
2021
2150
  {{#first}} {{{suburb}}} || {{{city_district}}} || {{{state_district}}} {{/first}}
2022
- {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{state}}} {{/first}}
2151
+ {{#first}} {{{city}}} || {{{town}}} || {{{village}}} || {{{hamlet}}} || {{{state}}} {{/first}}
2023
2152
  {{{postcode}}}
2024
2153
  {{{country}}}
2025
2154