pumi 0.43.0 → 0.44.1
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.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +1 -1
- data/.github/workflows/release.yml +1 -1
- data/.github/workflows/update_data.yml +2 -2
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +14 -0
- data/data/districts.yml +4 -4
- data/data/villages.yml +4 -4
- data/lib/pumi/data_source/ncdd.rb +1 -1
- data/lib/pumi/data_source/wikipedia.rb +23 -3
- data/lib/pumi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0074d955b52552bcbc18d39613c23fd1c8876d6b1ec743940e46445662845535
|
|
4
|
+
data.tar.gz: d8e1ea3adb1ca6f8ec5d18dadebfed0d195d8c1376e0062c3c0144627e8ef38e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e3056bbb81e8e371c2e7398b02549e65e5ad5298a76bd07852f87c97fd53e4a60797af24b6d96930b9ddade84516337ec8ac2249225641ee607220a6a17713dc
|
|
7
|
+
data.tar.gz: fdd044e262e2ed1e0e6b20aba9a3ae15fd68a139aaea7161010bf2165678d6321021a41661a44c29267e387652c7b85e97c7631fc90ed472b2d545d7f54c3b10
|
data/.github/workflows/build.yml
CHANGED
|
@@ -3,13 +3,13 @@ name: Update Data
|
|
|
3
3
|
on:
|
|
4
4
|
schedule:
|
|
5
5
|
- cron: '0 2 * * 0'
|
|
6
|
-
|
|
6
|
+
workflow_dispatch:
|
|
7
7
|
jobs:
|
|
8
8
|
fetch_data:
|
|
9
9
|
runs-on: ubuntu-latest
|
|
10
10
|
|
|
11
11
|
steps:
|
|
12
|
-
- uses: actions/checkout@
|
|
12
|
+
- uses: actions/checkout@v7
|
|
13
13
|
|
|
14
14
|
- name: Setup Ruby
|
|
15
15
|
uses: ruby/setup-ruby@v1
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.44.1](https://github.com/dwilkie/pumi/compare/v0.44.0...v0.44.1) (2026-09-13)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* Update misspellings ([#138](https://github.com/dwilkie/pumi/issues/138)) ([8ee4b04](https://github.com/dwilkie/pumi/commit/8ee4b04e6d7b7c5730acb60441948d5fc14f12bd))
|
|
9
|
+
|
|
10
|
+
## [0.44.0](https://github.com/dwilkie/pumi/compare/v0.43.0...v0.44.0) (2026-09-13)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* Update data ([#134](https://github.com/dwilkie/pumi/issues/134)) ([cee3021](https://github.com/dwilkie/pumi/commit/cee3021d14bc3cc1ef592559d112c44cd74037ea))
|
|
16
|
+
|
|
3
17
|
## [0.43.0](https://github.com/dwilkie/pumi/compare/v0.42.0...v0.43.0) (2026-06-01)
|
|
4
18
|
|
|
5
19
|
|
data/data/districts.yml
CHANGED
|
@@ -734,7 +734,7 @@ districts:
|
|
|
734
734
|
en: District
|
|
735
735
|
ungegn: Srŏk
|
|
736
736
|
links:
|
|
737
|
-
wikipedia: https://en.wikipedia.org/wiki/Rolea_B
|
|
737
|
+
wikipedia: https://en.wikipedia.org/wiki/Rolea_B'ier_District
|
|
738
738
|
geodata:
|
|
739
739
|
lat: '12.2059838'
|
|
740
740
|
long: '104.6613026'
|
|
@@ -1087,7 +1087,7 @@ districts:
|
|
|
1087
1087
|
'0609':
|
|
1088
1088
|
name:
|
|
1089
1089
|
km: តាំងគោក
|
|
1090
|
-
latin:
|
|
1090
|
+
latin: Taing Kouk
|
|
1091
1091
|
administrative_unit:
|
|
1092
1092
|
km: ស្រុក
|
|
1093
1093
|
latin: Srok
|
|
@@ -1448,7 +1448,7 @@ districts:
|
|
|
1448
1448
|
en: District
|
|
1449
1449
|
ungegn: Srŏk
|
|
1450
1450
|
links:
|
|
1451
|
-
wikipedia: https://en.wikipedia.org/wiki/S
|
|
1451
|
+
wikipedia: https://en.wikipedia.org/wiki/S'ang
|
|
1452
1452
|
geodata:
|
|
1453
1453
|
lat: '11.3605612'
|
|
1454
1454
|
long: '105.0037187'
|
|
@@ -3692,7 +3692,7 @@ districts:
|
|
|
3692
3692
|
en: District
|
|
3693
3693
|
ungegn: Srŏk
|
|
3694
3694
|
links:
|
|
3695
|
-
wikipedia: https://en.wikipedia.org/wiki/Damnak_Chang
|
|
3695
|
+
wikipedia: https://en.wikipedia.org/wiki/Damnak_Chang'aeur_District
|
|
3696
3696
|
geodata:
|
|
3697
3697
|
lat: '10.526653'
|
|
3698
3698
|
long: '104.36731'
|
data/data/villages.yml
CHANGED
|
@@ -14115,7 +14115,7 @@ villages:
|
|
|
14115
14115
|
'03010907':
|
|
14116
14116
|
name:
|
|
14117
14117
|
km: តាំងគោក
|
|
14118
|
-
latin:
|
|
14118
|
+
latin: Taing Kouk
|
|
14119
14119
|
administrative_unit:
|
|
14120
14120
|
km: ភូមិ
|
|
14121
14121
|
latin: Phum
|
|
@@ -19578,7 +19578,7 @@ villages:
|
|
|
19578
19578
|
'03130708':
|
|
19579
19579
|
name:
|
|
19580
19580
|
km: តាំងគោក
|
|
19581
|
-
latin:
|
|
19581
|
+
latin: Taing Kouk
|
|
19582
19582
|
administrative_unit:
|
|
19583
19583
|
km: ភូមិ
|
|
19584
19584
|
latin: Phum
|
|
@@ -46047,7 +46047,7 @@ villages:
|
|
|
46047
46047
|
'06090501':
|
|
46048
46048
|
name:
|
|
46049
46049
|
km: តាំងគោក
|
|
46050
|
-
latin:
|
|
46050
|
+
latin: Taing Kouk
|
|
46051
46051
|
administrative_unit:
|
|
46052
46052
|
km: ភូមិ
|
|
46053
46053
|
latin: Phum
|
|
@@ -90489,7 +90489,7 @@ villages:
|
|
|
90489
90489
|
'15070116':
|
|
90490
90490
|
name:
|
|
90491
90491
|
km: តាំងគោក
|
|
90492
|
-
latin:
|
|
90492
|
+
latin: Taing Kouk
|
|
90493
90493
|
administrative_unit:
|
|
90494
90494
|
km: ភូមិ
|
|
90495
90495
|
latin: Phum
|
|
@@ -23,7 +23,7 @@ module Pumi
|
|
|
23
23
|
Misspelling.new(incorrect_text: "Preaek Chrey", correct_text: "Preaek Chrey"),
|
|
24
24
|
Misspelling.new(incorrect_text: "Saensokh", correct_text: "Sen Sok"),
|
|
25
25
|
Misspelling.new(incorrect_text: "Kaeb", correct_text: "Kep"),
|
|
26
|
-
Misspelling.new(incorrect_text: "
|
|
26
|
+
Misspelling.new(incorrect_text: "Tang Kouk", correct_text: "Taing Kouk"),
|
|
27
27
|
Misspelling.new(incorrect_text: "Mongkol Borei", correct_text: "Mongkol Borey"),
|
|
28
28
|
Misspelling.new(incorrect_text: "wat Kor", correct_text: "Wat Kor"),
|
|
29
29
|
Misspelling.new(incorrect_text: "OMal", correct_text: "Ou Mal"),
|
|
@@ -43,6 +43,26 @@ module Pumi
|
|
|
43
43
|
|
|
44
44
|
ScraperResult = Struct.new(:code, :wikipedia, :name_ungegn, keyword_init: true)
|
|
45
45
|
|
|
46
|
+
class URLParser
|
|
47
|
+
attr_reader :base_url, :link_node
|
|
48
|
+
|
|
49
|
+
def self.parse(...)
|
|
50
|
+
new(...).to_s
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def initialize(base_url, link_node)
|
|
54
|
+
@base_url = base_url
|
|
55
|
+
@link_node = link_node
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def to_s
|
|
59
|
+
return if link_node.nil? || link_node[:href].nil?
|
|
60
|
+
|
|
61
|
+
escaped_href = URI::DEFAULT_PARSER.escape(link_node[:href])
|
|
62
|
+
URI.join(base_url, escaped_href).to_s
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
46
66
|
class WebScraper
|
|
47
67
|
class ElementNotFoundError < StandardError; end
|
|
48
68
|
|
|
@@ -79,7 +99,7 @@ module Pumi
|
|
|
79
99
|
def find_url(province)
|
|
80
100
|
td = find_khmer_name_td(province)
|
|
81
101
|
link = td.at_xpath("preceding-sibling::td/a[contains(@href, '/wiki/')]")
|
|
82
|
-
|
|
102
|
+
URLParser.parse(URL, link)
|
|
83
103
|
end
|
|
84
104
|
|
|
85
105
|
def find_ungegn(province)
|
|
@@ -141,7 +161,7 @@ module Pumi
|
|
|
141
161
|
|
|
142
162
|
return if link.nil?
|
|
143
163
|
|
|
144
|
-
|
|
164
|
+
URLParser.parse(URL, link)
|
|
145
165
|
end
|
|
146
166
|
|
|
147
167
|
def find_ungegn(district)
|
|
@@ -181,7 +201,7 @@ module Pumi
|
|
|
181
201
|
|
|
182
202
|
return if link.nil?
|
|
183
203
|
|
|
184
|
-
|
|
204
|
+
URLParser.parse(URL, link)
|
|
185
205
|
end
|
|
186
206
|
|
|
187
207
|
def find_ungegn(commune)
|
data/lib/pumi/version.rb
CHANGED
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.
|
|
4
|
+
version: 0.44.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Wilkie
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-09-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|