pumi 0.27.0 → 0.28.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0edb191327803e19be78cf0df10a233ddc7d2c0c214cf5b3088fb0fceb02fbc8
4
- data.tar.gz: 63d20104536e5e9b6c7dbcb3bf5e28a2c131519691896a516b59eec8a6f5fe2b
3
+ metadata.gz: 6173a8cb88e6f36eb1285df4d45eeda6f21c9d088c045825e07958e708f45b77
4
+ data.tar.gz: 7367b4e6006a5c8d181d68bf274ce11a0876f44a071ff35baa6ef23fb13c6472
5
5
  SHA512:
6
- metadata.gz: b8ad18b05472acee16d2cd265c45c7e5357b498e8d0e542086b678896db9e5d9ec007246a79c8842724f6f3d65f16ef71e459465e3affb9b6d011e951da0a023
7
- data.tar.gz: 1d5eecdadab48e1428bc92c7dc8cd7478ab2fa8235a0cf45eac1452f06748c486d78c37e8d33107f9026c4e47f236c15405e6e57188d9d0917120575b07406ea
6
+ metadata.gz: df2cd679ced41e365c64ea0064a69955250af50e9d4572e43bf21dc5bc092dad353b31a8178f4ff3c817090b58cf81c481d36f784d3b667c4b3840ff07716af6
7
+ data.tar.gz: a9e8769939d878b53351ab541a308712a6a86e488f8fb34925f6e9c0f11310e3129f47deb9d3dfca5632583a25072b1793ff24e4456907648a90790c9fcdf838
@@ -23,7 +23,7 @@ jobs:
23
23
  run: ./bin/parse_data
24
24
 
25
25
  - name: Create Pull Request
26
- uses: peter-evans/create-pull-request@v6
26
+ uses: peter-evans/create-pull-request@v7
27
27
  with:
28
28
  token: ${{ secrets.REPO_TOKEN }}
29
29
  commit-message: "feat: Update data"
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.27.0"
2
+ ".": "0.28.0"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.28.0](https://github.com/dwilkie/pumi/compare/v0.27.0...v0.28.0) (2024-09-09)
4
+
5
+
6
+ ### Features
7
+
8
+ * Update data ([#86](https://github.com/dwilkie/pumi/issues/86)) ([25c9296](https://github.com/dwilkie/pumi/commit/25c9296a7ce175961a14ba5e3dfaccea22e33d5d))
9
+
3
10
  ## [0.27.0](https://github.com/dwilkie/pumi/compare/v0.26.0...v0.27.0) (2024-05-26)
4
11
 
5
12
 
data/data/communes.yml CHANGED
@@ -19838,40 +19838,6 @@ communes:
19838
19838
  - 103.8613281
19839
19839
  - 10.6420899
19840
19840
  - 103.682678
19841
- '180202':
19842
- name:
19843
- km: បឹងតាព្រហ្ម
19844
- latin: Boeng Ta Prum
19845
- administrative_unit:
19846
- km: ឃុំ
19847
- latin: Khum
19848
- en: Commune
19849
- ungegn: Khŭm
19850
- geodata:
19851
- lat: 10.5724625
19852
- long: 103.7740888
19853
- bounding_box:
19854
- - 10.5963128
19855
- - 103.8399051
19856
- - 10.5314939
19857
- - 103.734131
19858
- '180203':
19859
- name:
19860
- km: បិតត្រាង
19861
- latin: Bet Trang
19862
- administrative_unit:
19863
- km: ឃុំ
19864
- latin: Khum
19865
- en: Commune
19866
- ungegn: Khŭm
19867
- geodata:
19868
- lat: 10.601182
19869
- long: 103.6239763
19870
- bounding_box:
19871
- - 10.6740719
19872
- - 103.646729
19873
- - 10.5400999
19874
- - 103.560913
19875
19841
  '180204':
19876
19842
  name:
19877
19843
  km: ជើងគោ
@@ -19889,40 +19855,6 @@ communes:
19889
19855
  - 103.891907
19890
19856
  - 10.7200929
19891
19857
  - 103.6737062
19892
- '180205':
19893
- name:
19894
- km: អូរជ្រៅ
19895
- latin: Ou Chrov
19896
- administrative_unit:
19897
- km: ឃុំ
19898
- latin: Khum
19899
- en: Commune
19900
- ungegn: Khŭm
19901
- geodata:
19902
- lat: 10.536239
19903
- long: 103.7878125
19904
- bounding_box:
19905
- - 10.5678709
19906
- - 103.8151249
19907
- - 10.51947
19908
- - 103.758484
19909
- '180206':
19910
- name:
19911
- km: អូរឧកញ៉ាហេង
19912
- latin: Ou Oknha Heng
19913
- administrative_unit:
19914
- km: ឃុំ
19915
- latin: Khum
19916
- en: Commune
19917
- ungegn: Khŭm
19918
- geodata:
19919
- lat: 10.5848478
19920
- long: 103.7439632
19921
- bounding_box:
19922
- - 10.6217039
19923
- - 103.8344731
19924
- - 10.54248
19925
- - 103.6903079
19926
19858
  '180207':
19927
19859
  name:
19928
19860
  km: ព្រៃនប់
@@ -19940,23 +19872,6 @@ communes:
19940
19872
  - 103.84967
19941
19873
  - 10.585083
19942
19874
  - 103.688721
19943
- '180208':
19944
- name:
19945
- km: រាម
19946
- latin: Ream
19947
- administrative_unit:
19948
- km: ឃុំ
19949
- latin: Khum
19950
- en: Commune
19951
- ungegn: Khŭm
19952
- geodata:
19953
- lat: '10.5113885'
19954
- long: '103.616945'
19955
- bounding_box:
19956
- - '10.5013885'
19957
- - '10.5213885'
19958
- - '103.606945'
19959
- - '103.626945'
19960
19875
  '180209':
19961
19876
  name:
19962
19877
  km: សាមគ្គី
@@ -20222,6 +20137,51 @@ communes:
20222
20137
  latin: Sangkat
20223
20138
  en: Quarter
20224
20139
  ungegn: Sângkéat
20140
+ '180601':
20141
+ name:
20142
+ km: រាម
20143
+ latin: Ream
20144
+ administrative_unit:
20145
+ km: សង្កាត់
20146
+ latin: Sangkat
20147
+ en: Quarter
20148
+ ungegn: Sângkéat
20149
+ '180602':
20150
+ name:
20151
+ km: បិតត្រាង
20152
+ latin: Bet Trang
20153
+ administrative_unit:
20154
+ km: សង្កាត់
20155
+ latin: Sangkat
20156
+ en: Quarter
20157
+ ungegn: Sângkéat
20158
+ '180603':
20159
+ name:
20160
+ km: អូរឧកញ៉ាហេង
20161
+ latin: Ou Oknha Heng
20162
+ administrative_unit:
20163
+ km: សង្កាត់
20164
+ latin: Sangkat
20165
+ en: Quarter
20166
+ ungegn: Sângkéat
20167
+ '180604':
20168
+ name:
20169
+ km: បឹងតាព្រហ្ម
20170
+ latin: Boeng Ta Prum
20171
+ administrative_unit:
20172
+ km: សង្កាត់
20173
+ latin: Sangkat
20174
+ en: Quarter
20175
+ ungegn: Sângkéat
20176
+ '180605':
20177
+ name:
20178
+ km: អូរជ្រៅ
20179
+ latin: Ou Chrov
20180
+ administrative_unit:
20181
+ km: សង្កាត់
20182
+ latin: Sangkat
20183
+ en: Quarter
20184
+ ungegn: Sângkéat
20225
20185
  '190101':
20226
20186
  name:
20227
20187
  km: កំភុន
data/data/districts.yml CHANGED
@@ -3110,6 +3110,15 @@ districts:
3110
3110
  ungegn: Krŏng
3111
3111
  links:
3112
3112
  wikipedia: https://en.wikipedia.org/wiki/Koh_Rong_(town)
3113
+ '1806':
3114
+ name:
3115
+ km: កំពង់សោម
3116
+ latin: Kampong Soam
3117
+ administrative_unit:
3118
+ km: ក្រុង
3119
+ latin: Krong
3120
+ en: Municipality
3121
+ ungegn: Krŏng
3113
3122
  '1901':
3114
3123
  name:
3115
3124
  km: សេសាន
data/data/villages.yml CHANGED
@@ -101142,87 +101142,6 @@ villages:
101142
101142
  latin: Phum
101143
101143
  en: Village
101144
101144
  ungegn: Phum
101145
- '18020201':
101146
- name:
101147
- km: បឹងជុំ
101148
- latin: Boeng Chum
101149
- administrative_unit:
101150
- km: ភូមិ
101151
- latin: Phum
101152
- en: Village
101153
- ungegn: Phum
101154
- '18020202':
101155
- name:
101156
- km: បឹងតាព្រហ្ម
101157
- latin: Boeng Ta Prum
101158
- administrative_unit:
101159
- km: ភូមិ
101160
- latin: Phum
101161
- en: Village
101162
- ungegn: Phum
101163
- '18020203':
101164
- name:
101165
- km: បឹងតាស្រី
101166
- latin: Boeng Ta Srei
101167
- administrative_unit:
101168
- km: ភូមិ
101169
- latin: Phum
101170
- en: Village
101171
- ungegn: Phum
101172
- '18020204':
101173
- name:
101174
- km: ដូនលយ
101175
- latin: Doun Loy
101176
- administrative_unit:
101177
- km: ភូមិ
101178
- latin: Phum
101179
- en: Village
101180
- ungegn: Phum
101181
- '18020205':
101182
- name:
101183
- km: ភ្នំតូច
101184
- latin: Phnum Touch
101185
- administrative_unit:
101186
- km: ភូមិ
101187
- latin: Phum
101188
- en: Village
101189
- ungegn: Phum
101190
- '18020206':
101191
- name:
101192
- km: ទឹកចេញ
101193
- latin: Tuek Chenh
101194
- administrative_unit:
101195
- km: ភូមិ
101196
- latin: Phum
101197
- en: Village
101198
- ungegn: Phum
101199
- '18020301':
101200
- name:
101201
- km: ចំណោតរាម
101202
- latin: Chamnaot Ream
101203
- administrative_unit:
101204
- km: ភូមិ
101205
- latin: Phum
101206
- en: Village
101207
- ungegn: Phum
101208
- '18020302':
101209
- name:
101210
- km: គគីរ
101211
- latin: Kokir
101212
- administrative_unit:
101213
- km: ភូមិ
101214
- latin: Phum
101215
- en: Village
101216
- ungegn: Phum
101217
- '18020303':
101218
- name:
101219
- km: ពូធឿង
101220
- latin: Pu Thoeang
101221
- administrative_unit:
101222
- km: ភូមិ
101223
- latin: Phum
101224
- en: Village
101225
- ungegn: Phum
101226
101145
  '18020401':
101227
101146
  name:
101228
101147
  km: ចំការកៅស៊ូ
@@ -101259,96 +101178,6 @@ villages:
101259
101178
  latin: Phum
101260
101179
  en: Village
101261
101180
  ungegn: Phum
101262
- '18020501':
101263
- name:
101264
- km: កោះខ្យង
101265
- latin: Kaoh Khyang
101266
- administrative_unit:
101267
- km: ភូមិ
101268
- latin: Phum
101269
- en: Village
101270
- ungegn: Phum
101271
- '18020502':
101272
- name:
101273
- km: អូរជ្រៅ
101274
- latin: Ou Chrov
101275
- administrative_unit:
101276
- km: ភូមិ
101277
- latin: Phum
101278
- en: Village
101279
- ungegn: Phum
101280
- '18020503':
101281
- name:
101282
- km: ស្រែចាមក្រោម
101283
- latin: Srae Cham Kraom
101284
- administrative_unit:
101285
- km: ភូមិ
101286
- latin: Phum
101287
- en: Village
101288
- ungegn: Phum
101289
- '18020504':
101290
- name:
101291
- km: ស្រែចាមលើ
101292
- latin: Srae Cham Leu
101293
- administrative_unit:
101294
- km: ភូមិ
101295
- latin: Phum
101296
- en: Village
101297
- ungegn: Phum
101298
- '18020505':
101299
- name:
101300
- km: ស្រែក្នុង
101301
- latin: Srae Knong
101302
- administrative_unit:
101303
- km: ភូមិ
101304
- latin: Phum
101305
- en: Village
101306
- ungegn: Phum
101307
- '18020601':
101308
- name:
101309
- km: បត់គគីរ
101310
- latin: Bat Kokir
101311
- administrative_unit:
101312
- km: ភូមិ
101313
- latin: Phum
101314
- en: Village
101315
- ungegn: Phum
101316
- '18020602':
101317
- name:
101318
- km: អូរចំណារ
101319
- latin: Ou Chamnar
101320
- administrative_unit:
101321
- km: ភូមិ
101322
- latin: Phum
101323
- en: Village
101324
- ungegn: Phum
101325
- '18020603':
101326
- name:
101327
- km: អូរតាប៉ាង
101328
- latin: Ou Ta Pang
101329
- administrative_unit:
101330
- km: ភូមិ
101331
- latin: Phum
101332
- en: Village
101333
- ungegn: Phum
101334
- '18020604':
101335
- name:
101336
- km: អូរតាសេក
101337
- latin: Ou Ta Sek
101338
- administrative_unit:
101339
- km: ភូមិ
101340
- latin: Phum
101341
- en: Village
101342
- ungegn: Phum
101343
- '18020605':
101344
- name:
101345
- km: អូរឧកញ៉ាហេង
101346
- latin: Ou Oknha Heng
101347
- administrative_unit:
101348
- km: ភូមិ
101349
- latin: Phum
101350
- en: Village
101351
- ungegn: Phum
101352
101181
  '18020701':
101353
101182
  name:
101354
101183
  km: បត់សិរមាន់
@@ -101394,42 +101223,6 @@ villages:
101394
101223
  latin: Phum
101395
101224
  en: Village
101396
101225
  ungegn: Phum
101397
- '18020801':
101398
- name:
101399
- km: អុង
101400
- latin: Ong
101401
- administrative_unit:
101402
- km: ភូមិ
101403
- latin: Phum
101404
- en: Village
101405
- ungegn: Phum
101406
- '18020802':
101407
- name:
101408
- km: រាម
101409
- latin: Ream
101410
- administrative_unit:
101411
- km: ភូមិ
101412
- latin: Phum
101413
- en: Village
101414
- ungegn: Phum
101415
- '18020804':
101416
- name:
101417
- km: ស្មាច់ដែង
101418
- latin: Smach Daeng
101419
- administrative_unit:
101420
- km: ភូមិ
101421
- latin: Phum
101422
- en: Village
101423
- ungegn: Phum
101424
- '18020805':
101425
- name:
101426
- km: ថ្មធំ
101427
- latin: Thma Thum
101428
- administrative_unit:
101429
- km: ភូមិ
101430
- latin: Phum
101431
- en: Village
101432
- ungegn: Phum
101433
101226
  '18020901':
101434
101227
  name:
101435
101228
  km: តាអោងធំ
@@ -101961,6 +101754,213 @@ villages:
101961
101754
  latin: Phum
101962
101755
  en: Village
101963
101756
  ungegn: Phum
101757
+ '18060101':
101758
+ name:
101759
+ km: អុង
101760
+ latin: Ong
101761
+ administrative_unit:
101762
+ km: ភូមិ
101763
+ latin: Phum
101764
+ en: Village
101765
+ ungegn: Phum
101766
+ '18060102':
101767
+ name:
101768
+ km: រាម
101769
+ latin: Ream
101770
+ administrative_unit:
101771
+ km: ភូមិ
101772
+ latin: Phum
101773
+ en: Village
101774
+ ungegn: Phum
101775
+ '18060103':
101776
+ name:
101777
+ km: ស្មាច់ដែង
101778
+ latin: Smach Daeng
101779
+ administrative_unit:
101780
+ km: ភូមិ
101781
+ latin: Phum
101782
+ en: Village
101783
+ ungegn: Phum
101784
+ '18060104':
101785
+ name:
101786
+ km: ថ្មធំ
101787
+ latin: Thma Thum
101788
+ administrative_unit:
101789
+ km: ភូមិ
101790
+ latin: Phum
101791
+ en: Village
101792
+ ungegn: Phum
101793
+ '18060201':
101794
+ name:
101795
+ km: ចំណោតរាម
101796
+ latin: Chamnaot Ream
101797
+ administrative_unit:
101798
+ km: ភូមិ
101799
+ latin: Phum
101800
+ en: Village
101801
+ ungegn: Phum
101802
+ '18060202':
101803
+ name:
101804
+ km: គគីរ
101805
+ latin: Kokir
101806
+ administrative_unit:
101807
+ km: ភូមិ
101808
+ latin: Phum
101809
+ en: Village
101810
+ ungegn: Phum
101811
+ '18060203':
101812
+ name:
101813
+ km: ពូធឿង
101814
+ latin: Pu Thoeang
101815
+ administrative_unit:
101816
+ km: ភូមិ
101817
+ latin: Phum
101818
+ en: Village
101819
+ ungegn: Phum
101820
+ '18060301':
101821
+ name:
101822
+ km: បត់គគីរ
101823
+ latin: Bat Kokir
101824
+ administrative_unit:
101825
+ km: ភូមិ
101826
+ latin: Phum
101827
+ en: Village
101828
+ ungegn: Phum
101829
+ '18060302':
101830
+ name:
101831
+ km: អូរចំណារ
101832
+ latin: Ou Chamnar
101833
+ administrative_unit:
101834
+ km: ភូមិ
101835
+ latin: Phum
101836
+ en: Village
101837
+ ungegn: Phum
101838
+ '18060303':
101839
+ name:
101840
+ km: អូរតាប៉ាង
101841
+ latin: Ou Ta Pang
101842
+ administrative_unit:
101843
+ km: ភូមិ
101844
+ latin: Phum
101845
+ en: Village
101846
+ ungegn: Phum
101847
+ '18060304':
101848
+ name:
101849
+ km: អូរតាសេក
101850
+ latin: Ou Ta Sek
101851
+ administrative_unit:
101852
+ km: ភូមិ
101853
+ latin: Phum
101854
+ en: Village
101855
+ ungegn: Phum
101856
+ '18060305':
101857
+ name:
101858
+ km: អូរឧកញ៉ាហេង
101859
+ latin: Ou Oknha Heng
101860
+ administrative_unit:
101861
+ km: ភូមិ
101862
+ latin: Phum
101863
+ en: Village
101864
+ ungegn: Phum
101865
+ '18060401':
101866
+ name:
101867
+ km: បឹងជុំ
101868
+ latin: Boeng Chum
101869
+ administrative_unit:
101870
+ km: ភូមិ
101871
+ latin: Phum
101872
+ en: Village
101873
+ ungegn: Phum
101874
+ '18060402':
101875
+ name:
101876
+ km: បឹងតាព្រហ្ម
101877
+ latin: Boeng Ta Prum
101878
+ administrative_unit:
101879
+ km: ភូមិ
101880
+ latin: Phum
101881
+ en: Village
101882
+ ungegn: Phum
101883
+ '18060403':
101884
+ name:
101885
+ km: បឹងតាស្រី
101886
+ latin: Boeng Ta Srei
101887
+ administrative_unit:
101888
+ km: ភូមិ
101889
+ latin: Phum
101890
+ en: Village
101891
+ ungegn: Phum
101892
+ '18060404':
101893
+ name:
101894
+ km: ដូនលយ
101895
+ latin: Doun Loy
101896
+ administrative_unit:
101897
+ km: ភូមិ
101898
+ latin: Phum
101899
+ en: Village
101900
+ ungegn: Phum
101901
+ '18060405':
101902
+ name:
101903
+ km: ភ្នំតូច
101904
+ latin: Phnum Touch
101905
+ administrative_unit:
101906
+ km: ភូមិ
101907
+ latin: Phum
101908
+ en: Village
101909
+ ungegn: Phum
101910
+ '18060406':
101911
+ name:
101912
+ km: ទឹកចេញ
101913
+ latin: Tuek Chenh
101914
+ administrative_unit:
101915
+ km: ភូមិ
101916
+ latin: Phum
101917
+ en: Village
101918
+ ungegn: Phum
101919
+ '18060501':
101920
+ name:
101921
+ km: កោះខ្យង
101922
+ latin: Kaoh Khyang
101923
+ administrative_unit:
101924
+ km: ភូមិ
101925
+ latin: Phum
101926
+ en: Village
101927
+ ungegn: Phum
101928
+ '18060502':
101929
+ name:
101930
+ km: អូរជ្រៅ
101931
+ latin: Ou Chrov
101932
+ administrative_unit:
101933
+ km: ភូមិ
101934
+ latin: Phum
101935
+ en: Village
101936
+ ungegn: Phum
101937
+ '18060503':
101938
+ name:
101939
+ km: ស្រែចាមក្រោម
101940
+ latin: Srae Cham Kraom
101941
+ administrative_unit:
101942
+ km: ភូមិ
101943
+ latin: Phum
101944
+ en: Village
101945
+ ungegn: Phum
101946
+ '18060504':
101947
+ name:
101948
+ km: ស្រែចាមលើ
101949
+ latin: Srae Cham Leu
101950
+ administrative_unit:
101951
+ km: ភូមិ
101952
+ latin: Phum
101953
+ en: Village
101954
+ ungegn: Phum
101955
+ '18060505':
101956
+ name:
101957
+ km: ស្រែក្នុង
101958
+ latin: Srae Knong
101959
+ administrative_unit:
101960
+ km: ភូមិ
101961
+ latin: Phum
101962
+ en: Village
101963
+ ungegn: Phum
101964
101964
  '19010101':
101965
101965
  name:
101966
101966
  km: កំភុន
@@ -64,7 +64,7 @@ module Pumi
64
64
  end
65
65
 
66
66
  PAGE_TITLE = "List_of_communes_in_Cambodia".freeze
67
- INTRO_TEXT = "<div id=\"intro\">The '''communes of Cambodia''' ({{lang|km|ឃុំ}} ''[[khum]]''/{{lang|km|សង្កាត់}} ''[[sangkat]]'') are the third-level administrative divisions in Cambodia. They are the subdivisions of the [[List of districts in Cambodia|districts and municipalities of Cambodia]]. Communes can consist of as few as %<min_villages>s<ref>{{cite web|url=http://db.ncdd.gov.kh/gazetteer/view/commune.castle?cm=%<smallest_commune_id>s |title=%<smallest_commune_name>s |publisher=National Committee for Sub-National Democratic Development }}</ref> or as many as %<max_villages>s<ref>{{cite web|url=http://db.ncdd.gov.kh/gazetteer/view/commune.castle?cm=%<largest_commune_id>s |title=%<largest_commune_name>s |publisher=National Committee for Sub-National Democratic Development }}</ref> villages (''[[phum]]''), depending on the population.\nThere are a total of %<communes_count>s communes and %<villages_count>s villages in Cambodia.</div>".freeze
67
+ INTRO_TEXT = "<div id=\"intro\">The '''communes of Cambodia''' ({{lang|km|ឃុំ}} ''[[khum]]''/{{lang|km|សង្កាត់}} ''[[sangkat]]'') are the third-level administrative divisions in Cambodia. They are the subdivisions of the [[List of districts in Cambodia|districts and municipalities of Cambodia]]. Communes can consist of as few as %<min_villages>s<ref>{{cite web|url=http://db.ncdd.gov.kh/gazetteer/view/commune.castle?cm=%<smallest_commune_id>s |title=%<smallest_commune_name>s |publisher=National Committee for Sub-National Democratic Development }}</ref> or as many as %<max_villages>s<ref>{{cite web|url=http://db.ncdd.gov.kh/gazetteer/view/commune.castle?cm=%<largest_commune_id>s |title=%<largest_commune_name>s |publisher=National Committee for Sub-National Democratic Development }}</ref> villages (''[[phum]]''), depending on the population.\nThere are a total of %<communes_count>s communes and %<villages_count>s villages in Cambodia.</div>".freeze
68
68
 
69
69
  TEMPLATE = File.read("#{__dir__}/templates/commune_list.wikitext.erb")
70
70
 
@@ -50,16 +50,28 @@ module Pumi
50
50
  end
51
51
 
52
52
  def generate_districts_summary(districts:)
53
+ village_administrative_unit = Pumi::Village.all.first.administrative_unit
54
+
53
55
  summary = districts_by_type(collection: districts).map do |au, d|
54
56
  next if Array(d).empty?
55
57
 
56
- text = "#{d.size} #{au.name_en}"
58
+ text = "#{format_number(d.size)} #{au.name_en}"
57
59
  if d.size > 1
58
60
  au.name_en.end_with?("y") ? text.chomp!("y") << "ies" : text << "s"
59
61
  end
60
62
  text << " (#{au.name_km} #{au.name_latin})"
61
63
  end
62
64
 
65
+ number_of_villages = 0
66
+ districts.each do |district|
67
+ number_of_villages += Pumi::Village.where(district_id: district.id).size
68
+ end
69
+ villages_text = "#{format_number(number_of_villages)} #{village_administrative_unit.name_en}"
70
+ villages_text << "s" if number_of_villages > 1
71
+ villages_text << " (#{village_administrative_unit.name_km} #{village_administrative_unit.name_latin})"
72
+
73
+ summary << villages_text
74
+
63
75
  if summary.size <= 2
64
76
  summary.join(" and ")
65
77
  else
@@ -112,6 +124,10 @@ module Pumi
112
124
  administrative_unit = collection.keys.find { |au| au.name_en == type }
113
125
  Array(collection[administrative_unit])
114
126
  end
127
+
128
+ def format_number(number)
129
+ number.to_s.gsub(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1,")
130
+ end
115
131
  end
116
132
  end
117
133
  end
@@ -1,17 +1,20 @@
1
1
  <div id="communes-list">
2
2
  <% provinces.each do |province| %>
3
- <% province_page = URI.parse(province.links[:wikipedia]).path.split("/").last %>
3
+ <% province_page = URI.parse(province.links[:wikipedia]).path.split("/").last -%>
4
4
  ==[[<%= province_page %>|<%= province.full_name_en %>]]==
5
5
  <div id="province-communes-<%= province.id %>">
6
6
  <%= province.name_en %> contains <%= province.communes_summary %>.<ref>{{cite web|url=http://db.ncdd.gov.kh/gazetteer/view/province.castle?pv=<%= province.id %> |title=<%= province.name_en %> |publisher=National Committee for Sub-National Democratic Development }}</ref>
7
-
8
7
  <% province.districts.each do |district| %>
9
- <% if district.links[:wikipedia] %>
10
- <% district_page = URI.parse(district.links[:wikipedia]).path.split("/").last %>
8
+ <% if district.links[:wikipedia] -%>
9
+ <% district_page = URI.parse(district.links[:wikipedia]).path.split("/").last -%>
10
+ <% if district_page.gsub("_", " ") == district.full_name_en -%>
11
+ ===[[<%= district.full_name_en %>]]===
12
+ <% else -%>
11
13
  ===[[<%= district_page %>|<%= district.full_name_en %>]]===
12
- <% else %>
14
+ <% end -%>
15
+ <% else -%>
13
16
  ===<%= district.full_name_en %>===
14
- <% end %>
17
+ <% end -%>
15
18
 
16
19
  <div id="district-communes-<%= district.id %>">
17
20
  <%= district.name_en %> contains <%= district.communes_summary %>.<ref>{{cite web|url=http://db.ncdd.gov.kh/gazetteer/view/district.castle?ds=<%= district.id %> |title=<%= district.name_en %> |publisher=National Committee for Sub-National Democratic Development }}</ref>
@@ -24,6 +27,7 @@
24
27
  ! [[Romanization of Khmer#UNGEGN|UNGEGN]]
25
28
  ! Administrative Unit
26
29
  ! Geocode
30
+ ! # of Villages
27
31
  |-
28
32
  <% district.communes.each_with_index do |commune, index| %>
29
33
  | <%= index + 1 %>
@@ -45,6 +49,7 @@
45
49
  <% end -%>
46
50
  | <%= "#{commune.administrative_unit.name_en} (#{commune.administrative_unit.name_km} #{commune.administrative_unit.name_latin})" %>
47
51
  | <%= commune.id %>
52
+ | <%= Village.where(commune_id: commune.id).size %>
48
53
  |-
49
54
  <% end -%>
50
55
  |}
@@ -18,7 +18,9 @@ module Pumi
18
18
 
19
19
  MISSPELLINGS = [
20
20
  Misspelling.new(incorrect_text: "Siem Reab", correct_text: "Siem Reap"),
21
- Misspelling.new(incorrect_text: "Aoral", correct_text: "Aural")
21
+ Misspelling.new(incorrect_text: "Aoral", correct_text: "Aural"),
22
+ Misspelling.new(incorrect_text: "Angk Romeas", correct_text: "Angk Romeas"),
23
+ Misspelling.new(incorrect_text: "Prea​ek Chrey", correct_text: "Preaek Chrey")
22
24
  ].freeze
23
25
 
24
26
  AdministrativeUnit = Struct.new(:en, :km, :latin, :ungegn, :code_length, :group, :type, keyword_init: true)
data/lib/pumi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pumi
2
- VERSION = "0.27.0".freeze
2
+ VERSION = "0.28.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pumi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.27.0
4
+ version: 0.28.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Wilkie
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-26 00:00:00.000000000 Z
11
+ date: 2024-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler