address_composer 0.1.3.pre → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/main.yml +25 -0
  3. data/.gitignore +2 -0
  4. data/.gitmodules +1 -1
  5. data/Gemfile.lock +24 -23
  6. data/README.md +3 -1
  7. data/address-formatting/.travis.yml +8 -6
  8. data/address-formatting/README.md +9 -2
  9. data/address-formatting/SECURITY.md +5 -0
  10. data/address-formatting/conf/abbreviations/{dk.yaml → da.yaml} +0 -3
  11. data/address-formatting/conf/abbreviations/de.yaml +0 -2
  12. data/address-formatting/conf/abbreviations/en.yaml +1 -1
  13. data/address-formatting/conf/abbreviations/fr.yaml +1 -1
  14. data/address-formatting/conf/abbreviations/hu.yaml +1 -2
  15. data/address-formatting/conf/abbreviations/nl.yaml +14 -1
  16. data/address-formatting/conf/abbreviations/no.yaml +16 -0
  17. data/address-formatting/conf/abbreviations/pl.yaml +24 -0
  18. data/address-formatting/conf/abbreviations/pt.yaml +0 -1
  19. data/address-formatting/conf/abbreviations/ru.yaml +45 -0
  20. data/address-formatting/conf/abbreviations/uk.yaml +0 -3
  21. data/address-formatting/conf/abbreviations/vn.yaml +7 -0
  22. data/address-formatting/conf/components.yaml +23 -4
  23. data/address-formatting/conf/countries/worldwide.yaml +168 -122
  24. data/address-formatting/conf/country2lang.yaml +3 -3
  25. data/address-formatting/conf/county_codes.yaml +369 -15
  26. data/address-formatting/conf/state_codes.yaml +1435 -129
  27. data/address-formatting/testcases/countries/as.yaml +7 -8
  28. data/address-formatting/testcases/countries/be.yaml +35 -0
  29. data/address-formatting/testcases/countries/bf.yaml +15 -1
  30. data/address-formatting/testcases/countries/ca.yaml +29 -5
  31. data/address-formatting/testcases/countries/cn.yaml +9 -0
  32. data/address-formatting/testcases/countries/de.yaml +1 -1
  33. data/address-formatting/testcases/countries/fr.yaml +81 -1
  34. data/address-formatting/testcases/countries/gb.yaml +90 -8
  35. data/address-formatting/testcases/countries/gg.yaml +2 -1
  36. data/address-formatting/testcases/countries/gu.yaml +2 -2
  37. data/address-formatting/testcases/countries/hk.yaml +18 -8
  38. data/address-formatting/testcases/countries/hm.yaml +1 -0
  39. data/address-formatting/testcases/countries/ie.yaml +45 -3
  40. data/address-formatting/testcases/countries/im.yaml +2 -1
  41. data/address-formatting/testcases/countries/je.yaml +2 -1
  42. data/address-formatting/testcases/countries/no.yaml +17 -0
  43. data/address-formatting/testcases/countries/pt.yaml +22 -0
  44. data/address-formatting/testcases/countries/ru.yaml +30 -0
  45. data/address-formatting/testcases/countries/sg.yaml +18 -1
  46. data/address-formatting/testcases/countries/sh.yaml +2 -1
  47. data/address-formatting/testcases/countries/ug.yaml +13 -0
  48. data/address-formatting/testcases/countries/um.yaml +1 -1
  49. data/address-formatting/testcases/countries/us.yaml +95 -10
  50. data/address-formatting/testcases/other/xx.yaml +28 -0
  51. data/address_composer.gemspec +4 -4
  52. data/lib/address_composer/version.rb +1 -1
  53. data/lib/address_composer.rb +9 -9
  54. metadata +21 -16
  55. data/.ruby-version +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d768e74414488a36d9941af1f3fe0db060ff8664
4
- data.tar.gz: 8b5c62d17693bc8456a3328d49145624c1fb5419
2
+ SHA256:
3
+ metadata.gz: 4c044946e2cf8967b36aa267c126579b5bcbf4e529abed3a121bac815265fb6f
4
+ data.tar.gz: 4849d192a1073e378624714e536e964846aff9e9297fc5a32ea96238e5abdbc0
5
5
  SHA512:
6
- metadata.gz: 5606dde039f00156bfcf558e1eb7e9e0da351957572077fab3f08f28713c8d7c155ec068351f639e6ea4fded9f89f9bae370aa5b83e1793367e8ec4f9530e117
7
- data.tar.gz: e67389b1c5431193693923ef1a118b820b3b6541ed32f0a0c137b565678e3b615a701767d2da2f83b1021db81138e98176ee1593914efb4ccfaeeb767cd92250
6
+ metadata.gz: 105c406cc5cf4f269ab44a07ebb31ed7f5db74705f38f0f3379dd23c1331cd86c873dd00f5846a608e221fef402f97a55c9a5320af92d8af61fe8dfa7d06abbb
7
+ data.tar.gz: eab56b159a893271e8815c2f4bc2d3ce3686cda249e6376e18fcafe444c08ef5831a10aba4e16ee220b0228de24fb62f2fd140895cd857b660f08137907c9784
@@ -0,0 +1,25 @@
1
+ name: Ruby
2
+
3
+ on: [push,pull_request]
4
+
5
+ jobs:
6
+ rspec:
7
+ strategy:
8
+ matrix:
9
+ ruby: [2.4, 2.5, 2.6, 2.7, 3.0]
10
+
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+ with:
16
+ submodules: recursive
17
+
18
+ - name: Set up Ruby
19
+ uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: ${{ matrix.ruby }}
22
+ bundler-cache: true
23
+
24
+ - name: Run tests
25
+ run: bundle exec rake spec
data/.gitignore CHANGED
@@ -9,3 +9,5 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+
13
+ .ruby-version
data/.gitmodules CHANGED
@@ -1,3 +1,3 @@
1
1
  [submodule "address-formatting"]
2
2
  path = address-formatting
3
- url = git@github.com:OpenCageData/address-formatting.git
3
+ url = https://github.com/OpenCageData/address-formatting.git
data/Gemfile.lock CHANGED
@@ -1,48 +1,49 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- address_composer (0.1.3.pre)
4
+ address_composer (1.0.1)
5
5
  mustache (~> 1.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  byebug (11.1.3)
11
- coderay (1.1.2)
12
- diff-lcs (1.3)
11
+ coderay (1.1.3)
12
+ diff-lcs (1.4.4)
13
13
  method_source (1.0.0)
14
14
  mustache (1.1.1)
15
- pry (0.13.1)
15
+ pry (0.14.1)
16
16
  coderay (~> 1.1)
17
17
  method_source (~> 1.0)
18
- pry-byebug (3.9.0)
18
+ pry-byebug (3.8.0)
19
19
  byebug (~> 11.0)
20
- pry (~> 0.13.0)
21
- rake (13.0.1)
22
- rspec (3.9.0)
23
- rspec-core (~> 3.9.0)
24
- rspec-expectations (~> 3.9.0)
25
- rspec-mocks (~> 3.9.0)
26
- rspec-core (3.9.1)
27
- rspec-support (~> 3.9.1)
28
- rspec-expectations (3.9.1)
20
+ pry (~> 0.10)
21
+ rake (13.0.6)
22
+ rspec (3.10.0)
23
+ rspec-core (~> 3.10.0)
24
+ rspec-expectations (~> 3.10.0)
25
+ rspec-mocks (~> 3.10.0)
26
+ rspec-core (3.10.1)
27
+ rspec-support (~> 3.10.0)
28
+ rspec-expectations (3.10.1)
29
29
  diff-lcs (>= 1.2.0, < 2.0)
30
- rspec-support (~> 3.9.0)
31
- rspec-mocks (3.9.1)
30
+ rspec-support (~> 3.10.0)
31
+ rspec-mocks (3.10.2)
32
32
  diff-lcs (>= 1.2.0, < 2.0)
33
- rspec-support (~> 3.9.0)
34
- rspec-support (3.9.2)
33
+ rspec-support (~> 3.10.0)
34
+ rspec-support (3.10.2)
35
35
 
36
36
  PLATFORMS
37
37
  ruby
38
+ x86_64-darwin-20
38
39
 
39
40
  DEPENDENCIES
40
41
  address_composer!
41
- bundler (~> 1.17)
42
- pry (~> 0.13)
43
- pry-byebug (~> 3.9)
42
+ bundler (~> 2.2)
43
+ pry (~> 0.14)
44
+ pry-byebug (~> 3.8)
44
45
  rake (~> 13.0)
45
- rspec (~> 3.0)
46
+ rspec (~> 3.10)
46
47
 
47
48
  BUNDLED WITH
48
- 1.17.3
49
+ 2.2.22
data/README.md CHANGED
@@ -48,7 +48,9 @@ United States of America
48
48
 
49
49
  ## Development
50
50
 
51
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
51
+ After checking out the repo, run `git submodule init` and `git submodule update` to fetch all the data from the submodule project and check out the mapped commit.
52
+
53
+ Then, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
52
54
 
53
55
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
54
56
 
@@ -1,10 +1,12 @@
1
- ---
2
- language: 'perl'
1
+ language: perl
3
2
  perl:
4
- - "5.26" # Ubuntu 18
3
+ - '5.30'
5
4
  env: PERL_CPANM_OPT="--notest --force --skip-satisfied"
6
5
  install:
7
- - cpanm File::Find::Rule~0.34
8
- - cpanm Geo::Address::Formatter~1.76
6
+ - cpanm File::Find::Rule~0.34
7
+ - cpanm Geo::Address::Formatter
9
8
  script:
10
- - bin/run_tests.t
9
+ - bin/run_tests.t
10
+ notifications:
11
+ slack:
12
+ secure: M7U87fLJ7oXOPjFDBASOwhNZXqRoYsTYtPxVbAHlQfS1at38IfK7/6rWdf7yNUPCV0JqfRCsR7frWQNncR9BbjtYSoDFywY/IcdVMoOl3haZJqXbA/LfGgI9ZIBAx5nBUlZkBaaq/RhXoKlNbZ89p6zq3qyvsUIgmUSkNTGejRU=
@@ -6,7 +6,8 @@ This project contains templates and test cases for address formats used in terri
6
6
 
7
7
  ### Build Status
8
8
 
9
- [![Build Status](https://travis-ci.org/OpenCageData/address-formatting.svg?branch=master)](https://travis-ci.org/OpenCageData/address-formatting)
9
+ [![Build Status](https://travis-ci.com/OpenCageData/address-formatting.svg?branch=master)](https://travis-ci.com/OpenCageData/address-formatting)
10
+ [![Twitter Follow](https://img.shields.io/twitter/follow/OpenCage?label=Follow%20OpenCage&style=social)](https://twitter.com/opencage)
10
11
 
11
12
  ### An example:
12
13
 
@@ -52,10 +53,16 @@ Our goal with this repository is a series of (programming) language independent
52
53
 
53
54
  There are open-source implementations in
54
55
 
56
+ * [Elixir](https://github.com/dkuku/ex_address_formatting)
57
+ * [Go](https://github.com/timonmasberg/address-formatter)
58
+ * [Java](https://github.com/placemarkt/address-formatter-java)
55
59
  * [Javascript](https://github.com/fragaria/address-formatter)
56
60
  * [Perl](https://metacpan.org/release/Geo-Address-Formatter)
57
61
  * [PHP](https://github.com/predicthq/address-formatter-php)
62
+ * [Python](https://github.com/dunkelstern/international_address_formatter)
63
+ * [Ruby](https://github.com/mirubiri/address_composer)
58
64
  * [Rust](https://github.com/CanalTP/address-formatter-rs)
65
+ * [Scala](https://github.com/ben-willis/address-formatter)
59
66
 
60
67
  We would love more language implementations. The more people who use the templates, the more likely bugs will be reported.
61
68
  If you write a processor, please submit a pull request adding it to the list. Thanks.
@@ -71,7 +78,7 @@ As of `Sun 17 Feb 2019` coverage is:
71
78
 
72
79
  This output is generated by `bin/coverage.pl`
73
80
 
74
- We need more language specific abbreviations. Please see `conf/abbreviations`. Pull requests wil lbe glaldy received.
81
+ We need more language specific abbreviations. Please see `conf/abbreviations`. Pull requests gladly received.
75
82
 
76
83
  A detailed breakdown of test and configuration coverage can be found by running `bin/coverage.pl -d`. A list of all known territories is in `conf/country_codes.yaml`
77
84
 
@@ -0,0 +1,5 @@
1
+ # Security Policy
2
+
3
+ ## Reporting a Vulnerability
4
+
5
+ Please see the [OpenCage security bounty page](https://opencagedata.com/security-bounty)
@@ -12,6 +12,3 @@ road:
12
12
  Vestre: V
13
13
  Øster: Ø
14
14
  Østre: Ø
15
-
16
-
17
-
@@ -3,5 +3,3 @@ road:
3
3
  Sankt: St
4
4
  Straße: Str
5
5
  Strasse: Str
6
-
7
-
@@ -28,4 +28,4 @@ road:
28
28
  Square: Sq
29
29
  Street: St
30
30
  Terrace: Tce
31
- Throughway: TRWY
31
+ Throughway: TRWY
@@ -7,4 +7,4 @@ road:
7
7
  Rue: r
8
8
  Saint: St
9
9
  Sainte: Ste
10
- Zone industrielle: Z.I
10
+ Zone industrielle: Z.I
@@ -1,4 +1,3 @@
1
1
  road:
2
2
  utca: u
3
-
4
-
3
+ körút: krt
@@ -1,13 +1,26 @@
1
1
  road:
2
+ Burgemeester: Burg
3
+ Docter: Dr
4
+ Dokter: Dr
5
+ Gebroeders: Gebr
6
+ Generaal: Gen
2
7
  Gracht: Gr
8
+ Kardinaal: Kard
9
+ Kolonel: Kol
3
10
  Kort: K
4
11
  Korte: Kte
5
12
  Laan: ln
6
13
  Lange: L
7
14
  Markt: mkt
15
+ Minister: Min
16
+ Monseigneur: Mgr
17
+ Pastoor: Past
18
+ Prins: Pr
19
+ Prinses: Pr
8
20
  Professor: Prof
9
21
  Sint: St
10
22
  Straat: str
11
23
  Van: v
24
+ Vrouwe: Vr
12
25
  Weg: wg
13
-
26
+ Zuster: Zr
@@ -0,0 +1,16 @@
1
+ road:
2
+ gata: g
3
+ gate: g
4
+ gaten: g
5
+ plass: pl
6
+ plassen: pl
7
+ sving: sv
8
+ svingen: sv
9
+ veg: v
10
+ vegen: v
11
+ vei: v
12
+ veien: v
13
+
14
+
15
+
16
+
@@ -0,0 +1,24 @@
1
+ road:
2
+ Aleja: al.
3
+ Aleje: al.
4
+ Alei: al.
5
+ Alejach: al.
6
+ Aleją: al.
7
+ Biskupa: bpa.
8
+ Biskup: bp.
9
+ Doktora: dr.
10
+ Księcia: ks.
11
+ Księdza: ks.
12
+ Kardynała: kard.
13
+ Marszałka: marsz.
14
+ Majora: mjr.
15
+ Plac: pl.
16
+ Placu: pl.
17
+ Placem: pl.
18
+ Profesora: prof.
19
+ Pułkownika: płk.
20
+ Rotmistrza: rotm.
21
+ Ulica: ul.
22
+ Ulice: ul.
23
+ Ulicą: ul.
24
+ Ulicy: ul.
@@ -28,4 +28,3 @@ road:
28
28
  Urbanização: Urb
29
29
  Vila: Vl
30
30
  Zona: Zn
31
-
@@ -0,0 +1,45 @@
1
+ country:
2
+ Российская Федерация: РФ
3
+ state:
4
+ автономный округ: АО
5
+ автономная область: Аобл
6
+ область: обл
7
+ Республика: Респ
8
+ county:
9
+ городской округ: г.о.
10
+ сельский округ: с.о.
11
+ район: р-н
12
+ city:
13
+ город: г
14
+ сельское поселение: с.п.
15
+ сельский совет: с.с.
16
+ village:
17
+ поселок: пос
18
+ посёлок: пос
19
+ дачный поселок: дп
20
+ дачный посёлок: дп
21
+ деревня: д
22
+ курортный поселок: кп
23
+ курортный посёлок: кп
24
+ местечко: м
25
+ село: с
26
+ станица: ст-ца
27
+ поселок городского типа: пгт
28
+ посёлок городского типа: пгт
29
+ neighbourhood:
30
+ квартал: кв-л
31
+ район: р-н
32
+ микрорайон: мкр
33
+ road:
34
+ улица: ул
35
+ дорога: дор
36
+ переулок: пер
37
+ шоссе: ш
38
+ проспект: пр-кт
39
+ проезд: пр
40
+ площадь: пл
41
+ бульвар: б-р
42
+ набережная: наб
43
+ корпус: корп
44
+ строение: стр
45
+ тупик: туп
@@ -6,6 +6,3 @@ road:
6
6
  проспект: просп
7
7
  шосе: ш
8
8
  вулиця: вул
9
-
10
-
11
-
@@ -0,0 +1,7 @@
1
+ road:
2
+ Công trường: CT
3
+ Đại lộ: ĐL
4
+ Đường: D
5
+ Quảng trường: QT
6
+
7
+
@@ -7,6 +7,9 @@ name: house
7
7
  aliases:
8
8
  - building
9
9
  - public_building
10
+ - isolated_dwelling
11
+ - farmland
12
+ - allotments
10
13
  ---
11
14
  name: road
12
15
  aliases:
@@ -21,37 +24,51 @@ aliases:
21
24
  - square
22
25
  - place
23
26
  ---
24
- name: village
27
+ name: hamlet
25
28
  aliases:
26
- - hamlet
27
29
  - locality
28
30
  - croft
29
31
  ---
32
+ name: village
33
+ ---
30
34
  name: neighbourhood
31
35
  aliases:
32
36
  - suburb
33
37
  - city_district
34
38
  - district
35
39
  - quarter
40
+ - borough
41
+ - city_block
36
42
  - residential
37
43
  - commercial
38
44
  - industrial
39
45
  - houses
46
+ - subdistrict
40
47
  - subdivision
48
+ - ward
49
+ ---
50
+ name: postal_city
41
51
  ---
42
52
  name: city
43
53
  aliases:
44
54
  - town
45
- - municipality
55
+ - township
46
56
  ---
47
- name: county
57
+ name: municipality
48
58
  aliases:
49
59
  - local_administrative_area
60
+ - subcounty
61
+ ---
62
+ name: county
63
+ aliases:
50
64
  - county_code
65
+ - department
51
66
  ---
52
67
  name: state_district
53
68
  ---
54
69
  name: postcode
70
+ aliases:
71
+ - partial_postcode
55
72
  ---
56
73
  name: state
57
74
  aliases:
@@ -62,6 +79,8 @@ name: region
62
79
  ---
63
80
  name: island
64
81
  ---
82
+ name: archipelago
83
+ ---
65
84
  name: country
66
85
  aliases:
67
86
  - country_name