pumi 0.45.0 → 0.45.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/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +7 -0
- data/data/communes.yml +1 -1
- data/data/districts.yml +1 -1
- data/data/villages.yml +1 -1
- data/lib/pumi/bot/wikipedia/districts_in_cambodia_article.rb +4 -1
- data/lib/pumi/bot/wikipedia/templates/district_list.wikitext.erb +3 -3
- data/lib/pumi/data_source/ncdd.rb +2 -1
- data/lib/pumi/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4a33836ec5c4cf4bbea745ce517f4fac22ee6b9f354ab3425fc420a160cedb1b
|
|
4
|
+
data.tar.gz: b29653f837920b884eb1ae21fdf3b93175fca770fb379e5879a45b7942ce80d8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 47a515936b8376e728ad170ca4992316e5ff760abb61fb9eafdf909d3059159257a95d3141430e291b383839992f8ced9ea7cd913a39882fad688af9b3e3996a
|
|
7
|
+
data.tar.gz: 8b438493d30ef85eb575cfbd7e45b6067fb4a10a49d58ce308cf9249e663045e6feb7b43f236f555c9e30e029eaca3f7d87241939a5bd010b8b6d7e5c3a8e1c8
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.45.1](https://github.com/dwilkie/pumi/compare/v0.45.0...v0.45.1) (2026-11-17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* Add misspelling for Arey Ksat ([#145](https://github.com/dwilkie/pumi/issues/145)) ([5edbb03](https://github.com/dwilkie/pumi/commit/5edbb037b8a06479e66fbe56e892349ea6f1ab2e))
|
|
9
|
+
|
|
3
10
|
## [0.45.0](https://github.com/dwilkie/pumi/compare/v0.44.2...v0.45.0) (2026-11-17)
|
|
4
11
|
|
|
5
12
|
|
data/data/communes.yml
CHANGED
|
@@ -11377,7 +11377,7 @@ communes:
|
|
|
11377
11377
|
'081307':
|
|
11378
11378
|
name:
|
|
11379
11379
|
km: អរិយក្សត្រ
|
|
11380
|
-
latin:
|
|
11380
|
+
latin: Arey Ksat
|
|
11381
11381
|
administrative_unit:
|
|
11382
11382
|
km: សង្កាត់
|
|
11383
11383
|
latin: Sangkat
|
data/data/districts.yml
CHANGED
data/data/villages.yml
CHANGED
|
@@ -59772,7 +59772,7 @@ villages:
|
|
|
59772
59772
|
'08130701':
|
|
59773
59773
|
name:
|
|
59774
59774
|
km: អរិយក្សត្រ
|
|
59775
|
-
latin:
|
|
59775
|
+
latin: Arey Ksat
|
|
59776
59776
|
administrative_unit:
|
|
59777
59777
|
km: ភូមិ
|
|
59778
59778
|
latin: Phum
|
|
@@ -6,6 +6,7 @@ module Pumi
|
|
|
6
6
|
module Wikipedia
|
|
7
7
|
class DistrictsInCambodiaArticle < Article
|
|
8
8
|
PAGE_TITLE = "List_of_districts,_municipalities_and_sections_in_Cambodia".freeze
|
|
9
|
+
# PAGE_TITLE = "User:Dcwilkie%2Fsandbox%2FList_of_districts,_municipalities_and_sections_in_Cambodia".freeze
|
|
9
10
|
|
|
10
11
|
INTRO_TEXT = "This is a list of [[Cambodia]]'s %<districts_count>s districts ({{lang|km|ស្រុក}} ''srok''), %<municipalities_count>s district-level municipalities ({{lang|km|ក្រុង}} ''krong'') and %<sections_count>s sections ({{lang|km|ខណ្ឌ}} ''khan'') organized by each [[Provinces of Cambodia|province]] and an [[Provinces of Cambodia|autonomous municipality]] ([[Phnom Penh]]).".freeze
|
|
11
12
|
DISTRICTS_TEMPLATE = File.read("#{__dir__}/templates/district_list.wikitext.erb")
|
|
@@ -83,7 +84,9 @@ module Pumi
|
|
|
83
84
|
misspelling = MISSPELLINGS.find { |m| m.correct_text == title }
|
|
84
85
|
search_term = misspelling&.incorrect_text || title
|
|
85
86
|
|
|
86
|
-
section = source.match(
|
|
87
|
+
section = source.match(
|
|
88
|
+
/==\s*\[\[[[:word:]\s]+\|#{Regexp.escape(search_term)}\]\]\s*==.+?(\n*<div id="province-districts-.+?(?===|\z))/m
|
|
89
|
+
)
|
|
87
90
|
|
|
88
91
|
raise "Missing section for #{search_term}" if section.nil?
|
|
89
92
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div id="province-districts-<%= province.id %>">
|
|
2
|
-
<%= province.name_en %> contains <%= districts_summary %>.<ref>{{cite web|url=
|
|
2
|
+
<%= province.name_en %> contains <%= districts_summary %>.<ref>{{cite web|url=https://db.ncdd.gov.kh/gazetteer/view/province.castle?pv=<%= province.id %> |title=<%= province.name_en %> |publisher=National Committee for Sub-National Democratic Development }}</ref>
|
|
3
3
|
|
|
4
4
|
{| class="wikitable sortable"
|
|
5
5
|
|-
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
<% districts.each_with_index do |district, index| %>
|
|
14
14
|
| <%= index + 1 %>
|
|
15
15
|
<% if district.links[:wikipedia] -%>
|
|
16
|
-
<% district_page = URI.parse(district.links[:wikipedia]).path.split("/").last -%>
|
|
17
|
-
<% if district_page
|
|
16
|
+
<% district_page = URI.decode_www_form_component(URI.parse(district.links[:wikipedia]).path.split("/").last).tr("_", " ") -%>
|
|
17
|
+
<% if district_page == district.name_en -%>
|
|
18
18
|
| [[<%= district.name_en %>]]
|
|
19
19
|
<% else -%>
|
|
20
20
|
| [[<%= district_page %>|<%= district.name_en %>]]
|
|
@@ -27,7 +27,8 @@ module Pumi
|
|
|
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"),
|
|
30
|
-
Misspelling.new(incorrect_text: "Paoy Paet", correct_text: "Poipet")
|
|
30
|
+
Misspelling.new(incorrect_text: "Paoy Paet", correct_text: "Poipet"),
|
|
31
|
+
Misspelling.new(incorrect_text: "Akreiy Ksatr", correct_text: "Arey Ksat")
|
|
31
32
|
].freeze
|
|
32
33
|
|
|
33
34
|
AdministrativeUnit = Struct.new(:en, :km, :latin, :ungegn, :code_length, :group, :type, keyword_init: true)
|
data/lib/pumi/version.rb
CHANGED