polytypo 1.20.1 → 1.22.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.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/lib/polytypo/data/VERSION +1 -1
  3. data/lib/polytypo/data/fixtures/bg.json +23 -4
  4. data/lib/polytypo/data/fixtures/cs.json +20 -1
  5. data/lib/polytypo/data/fixtures/de-CH.json +23 -4
  6. data/lib/polytypo/data/fixtures/de-DE.json +124 -13
  7. data/lib/polytypo/data/fixtures/el.json +39 -4
  8. data/lib/polytypo/data/fixtures/en-GB.json +34 -7
  9. data/lib/polytypo/data/fixtures/en-US.json +988 -162
  10. data/lib/polytypo/data/fixtures/es.json +12 -1
  11. data/lib/polytypo/data/fixtures/fi.json +21 -2
  12. data/lib/polytypo/data/fixtures/fr-CA.json +20 -1
  13. data/lib/polytypo/data/fixtures/fr.json +57 -13
  14. data/lib/polytypo/data/fixtures/hr.json +20 -1
  15. data/lib/polytypo/data/fixtures/hu.json +39 -4
  16. data/lib/polytypo/data/fixtures/it.json +12 -1
  17. data/lib/polytypo/data/fixtures/locale-resolution.json +1 -1
  18. data/lib/polytypo/data/fixtures/lt.json +20 -1
  19. data/lib/polytypo/data/fixtures/nl.json +28 -1
  20. data/lib/polytypo/data/fixtures/pl.json +28 -1
  21. data/lib/polytypo/data/fixtures/pt-BR.json +20 -1
  22. data/lib/polytypo/data/fixtures/pt-PT.json +20 -1
  23. data/lib/polytypo/data/fixtures/ro.json +13 -2
  24. data/lib/polytypo/data/fixtures/ru.json +49 -6
  25. data/lib/polytypo/data/fixtures/sk.json +20 -1
  26. data/lib/polytypo/data/fixtures/sl.json +20 -1
  27. data/lib/polytypo/data/fixtures/sr.json +23 -4
  28. data/lib/polytypo/data/fixtures/sv.json +23 -4
  29. data/lib/polytypo/data/fixtures/tr.json +20 -1
  30. data/lib/polytypo/data/fixtures/uk.json +12 -1
  31. data/lib/polytypo/data/locales/bg.json +10 -1
  32. data/lib/polytypo/data/locales/cs.json +3 -0
  33. data/lib/polytypo/data/locales/de-CH.json +15 -1
  34. data/lib/polytypo/data/locales/de-DE.json +16 -1
  35. data/lib/polytypo/data/locales/el.json +10 -1
  36. data/lib/polytypo/data/locales/en-GB.json +16 -4
  37. data/lib/polytypo/data/locales/en-US.json +18 -11
  38. data/lib/polytypo/data/locales/es.json +3 -0
  39. data/lib/polytypo/data/locales/fi.json +9 -3
  40. data/lib/polytypo/data/locales/fr-CA.json +10 -1
  41. data/lib/polytypo/data/locales/fr.json +4 -1
  42. data/lib/polytypo/data/locales/hr.json +4 -1
  43. data/lib/polytypo/data/locales/hu.json +10 -1
  44. data/lib/polytypo/data/locales/it.json +3 -0
  45. data/lib/polytypo/data/locales/lt.json +13 -5
  46. data/lib/polytypo/data/locales/nl.json +11 -2
  47. data/lib/polytypo/data/locales/pl.json +11 -2
  48. data/lib/polytypo/data/locales/pt-BR.json +5 -2
  49. data/lib/polytypo/data/locales/pt-PT.json +6 -3
  50. data/lib/polytypo/data/locales/registry.json +1 -1
  51. data/lib/polytypo/data/locales/ro.json +3 -0
  52. data/lib/polytypo/data/locales/ru.json +10 -17
  53. data/lib/polytypo/data/locales/sk.json +8 -5
  54. data/lib/polytypo/data/locales/sl.json +4 -1
  55. data/lib/polytypo/data/locales/sr.json +10 -2
  56. data/lib/polytypo/data/locales/sv.json +9 -6
  57. data/lib/polytypo/data/locales/tr.json +5 -2
  58. data/lib/polytypo/data/locales/uk.json +3 -0
  59. data/lib/polytypo/data/rules/modes.md +2 -2
  60. data/lib/polytypo/data/rules/nbsp.md +271 -74
  61. data/lib/polytypo/data/rules/order.json +9 -1
  62. data/lib/polytypo/data/rules/pipeline-idempotency.md +76 -9
  63. data/lib/polytypo/data/rules/quote-punctuation.md +337 -0
  64. data/lib/polytypo/data/rules/quotes.md +23 -5
  65. data/lib/polytypo/data/rules/ranges.md +7 -1
  66. data/lib/polytypo/data/rules/spaces.md +4 -2
  67. data/lib/polytypo/data/rules/symbols.md +2 -1
  68. data/lib/polytypo/data/schema/fixtures.schema.json +1 -0
  69. data/lib/polytypo/data/schema/locale.schema.json +27 -2
  70. data/lib/polytypo/engine/locale.rb +22 -1
  71. data/lib/polytypo/engine/pipeline.rb +1 -1
  72. data/lib/polytypo/engine/rules/nbsp.rb +161 -11
  73. data/lib/polytypo/engine/rules/quote_punctuation.rb +79 -0
  74. data/lib/polytypo/engine/rules.rb +1 -0
  75. data/lib/polytypo/version.rb +1 -1
  76. metadata +3 -1
@@ -12,6 +12,7 @@
12
12
  "close": "’",
13
13
  "innerSpace": "none"
14
14
  },
15
+ "punctuationPlacement": "none",
15
16
  "elisionIdioms": [],
16
17
  "elisionClitics": {
17
18
  "before": [],
@@ -36,14 +37,8 @@
36
37
  "afterShortWords": [],
37
38
  "abbreviations": [],
38
39
  "beforeUnits": [
39
- "%",
40
- "‰",
41
- "kr",
42
- "€",
43
- "kg",
44
40
  "g",
45
41
  "mg",
46
- "km",
47
42
  "m",
48
43
  "cm",
49
44
  "mm",
@@ -59,6 +54,8 @@
59
54
  "h",
60
55
  "°C"
61
56
  ],
57
+ "spacedUnits": ["%", "‰", "kr", "€", "km", "kg"],
58
+ "closedUnits": [],
62
59
  "beforeNumber": [],
63
60
  "beforeWord": [],
64
61
  "afterSymbols": ["§"],
@@ -123,6 +120,12 @@
123
120
  "cite": "Språkrådet, Snabba skrivregler, §4.4 (sammansättningar med förkortningar) and kap. 7 (avstavning)",
124
121
  "url": "https://www.diva-portal.org/smash/get/diva2:1829117/FULLTEXT04.pdf",
125
122
  "note": "`prefixes`, `suffixes` and `compounds` are empty. The guide’s hyphen material states when to insert a bindestreck in compounds (e-post, EU-länderna, FN-arbete, satellit-tv-program, lan-spel) and treats avstavning as a separate topic; it never forbids a line break at an existing hyphen. Swedish compounding is productive, so there is no closed inventory to list — the field exists for the Russian кое- / -таки / из-под case. No U+2011 requirement found in any Språkrådet material consulted."
123
+ },
124
+ {
125
+ "rule": "nbsp",
126
+ "cite": "Myndigheternas skrivregler (Ds 2009:38), §10.15 «Procent och promille»: «Mellanslag sätts före tecknet.»; Snabba skrivregler §5.1.1 och §1.16: «10 km, 11 kg», «pris 7,50 kr», «3 € (tre euro)»",
127
+ "url": "https://www.regeringen.se/contentassets/cf18bfb62e0c4282ab3e8632080c2fb4/myndigheternas-skrivregler-ds-200938",
128
+ "note": "%, ‰, kr, €, km, kg in spacedUnits. Other units stay in beforeUnits: the sources list their symbols without a number. °C and bare ° were not found in either document. Retrieved 2026-11-11."
126
129
  }
127
130
  ]
128
131
  }
@@ -12,6 +12,7 @@
12
12
  "close": "’",
13
13
  "innerSpace": "none"
14
14
  },
15
+ "punctuationPlacement": "none",
15
16
  "elisionIdioms": [],
16
17
  "elisionClitics": {
17
18
  "before": [],
@@ -35,7 +36,9 @@
35
36
  "narrowBeforePunctuation": [],
36
37
  "afterShortWords": [],
37
38
  "abbreviations": ["Kur. Bşk.", "Nö. Sb."],
38
- "beforeUnits": ["mm", "cm", "km", "kg", "mg", "hl", "m²", "cm²", "°C", "ton"],
39
+ "beforeUnits": [],
40
+ "spacedUnits": ["mm", "cm", "km", "kg", "mg", "hl", "m²", "cm²", "°C", "ton"],
41
+ "closedUnits": [],
39
42
  "beforeNumber": [],
40
43
  "beforeWord": [],
41
44
  "afterSymbols": [],
@@ -100,7 +103,7 @@
100
103
  "rule": "nbsp",
101
104
  "cite": "Türk Dil Kurumu, Sıkça Sorulan Sorular, «°C \"santigrat derece\" işaretiyle sayı arasında boşluk bırakılır mı?»: «Sayı ve ölçü birimi kısaltmaları aralarında boşluk bırakılır. Tıpkı 5 m, 20 kg, 350 ton örneklerinde olduğu gibi, °C \"santigrat derece\" işaretiyle sayı arasında boşluk bırakılır: 15 °C gibi.»; Türk Dil Kurumu, Yazım Kuralları, «Kısaltmalar» 2: «Ölçü birimlerinin uluslararası kısaltmaları kullanılır: m (metre), mm (milimetre), cm (santimetre), km (kilometre), g (gram), kg (kilogram), l (litre), hl (hektolitre), mg (miligram), m² (metrekare), cm² (santimetrekare) vb.»",
102
105
  "url": "https://tdk.gov.tr/icerik/sikca-sorulan-sorular/c-derece-santigrat-isaretiyle-sayi-arasinda-bosluk-birakilir-mi/",
103
- "note": "beforeUnits. Rol paylaşımı başka locale'lerdeki gibi iki kuruma değil tek kuruma düşüyor: hangi dizgilerin uluslararası birim simgesi olduğunu «Kısaltmalar» 2, aralarında boşluk bırakıldığını SSS söylüyor. KAYNAK RÜTBESİ açıkça belirtiliyor: Sıkça Sorulan Sorular, Yazım Kılavuzu'nun altındadır ve boşluk hükmünün tek dayanağı odur. Tek harfli simgeler (m, g, l) fr.json ve pl.json uygulamasına uyularak atlandı. «ton» ayrıca açıklanıyor: uluslararası bir simge değil bir kelimedir ve yalnızca SSS'nin düzyazı örneğinden («350 ton») gelir — listede tutulmasının nedeni N5'in sağ sınır testinin onu «tonluk» içinde eşleştirmemesi ve hiçbir şey uydurulmamış olmasıdır. «cm» ile «cm²» birlikte listelenebilir, çünkü aynı konumda EN UZUN EŞLEŞME KAZANIR (nbsp.md §3.7) — «15 cm²» girdisinde «cm» değil «cm²» eşleşir. «%» BİLEREK YOK: TDK yüzde işaretini sayıdan ÖNCE ve bitişik yazar (ayrı kayıt). N5 yalnızca var olan bir boşluğu DÖNÜŞTÜRÜR, asla eklemez (nbsp.md §3.7 madde 3), bu yüzden «20kg» dokunulmadan kalır. Erişim: 23.09.2026."
106
+ "note": "beforeUnits. Rol paylaşımı başka locale'lerdeki gibi iki kuruma değil tek kuruma düşüyor: hangi dizgilerin uluslararası birim simgesi olduğunu «Kısaltmalar» 2, aralarında boşluk bırakıldığını SSS söylüyor. KAYNAK RÜTBESİ açıkça belirtiliyor: Sıkça Sorulan Sorular, Yazım Kılavuzu'nun altındadır ve boşluk hükmünün tek dayanağı odur. Tek harfli simgeler (m, g, l) fr.json ve pl.json uygulamasına uyularak atlandı. «ton» ayrıca açıklanıyor: uluslararası bir simge değil bir kelimedir ve yalnızca SSS'nin düzyazı örneğinden («350 ton») gelir — listede tutulmasının nedeni N5'in sağ sınır testinin onu «tonluk» içinde eşleştirmemesi ve hiçbir şey uydurulmamış olmasıdır. «cm» ile «cm²» birlikte listelenebilir, çünkü aynı konumda EN UZUN EŞLEŞME KAZANIR (nbsp.md §3.7) — «15 cm²» girdisinde «cm» değil «cm²» eşleşir. «%» BİLEREK YOK: TDK yüzde işaretini sayıdan ÖNCE ve bitişik yazar (ayrı kayıt). «20kg» N5 tarafından «20 kg» yapılır (spacedUnits). Erişim: 23.09.2026."
104
107
  },
105
108
  {
106
109
  "rule": "nbsp",
@@ -12,6 +12,7 @@
12
12
  "close": "”",
13
13
  "innerSpace": "none"
14
14
  },
15
+ "punctuationPlacement": "none",
15
16
  "elisionIdioms": [],
16
17
  "elisionClitics": {
17
18
  "before": [],
@@ -76,6 +77,8 @@
76
77
  "грн",
77
78
  "р."
78
79
  ],
80
+ "spacedUnits": [],
81
+ "closedUnits": [],
79
82
  "beforeNumber": [],
80
83
  "beforeWord": ["акад.", "доц.", "проф."],
81
84
  "afterSymbols": [],
@@ -165,7 +165,7 @@ simply a member of `BREAK` and of nothing else, so it needs no table: every rule
165
165
  | `DOTLIKE`, `STRIP-BEFORE`, `TERMINAL` | **no** |
166
166
  | `STRAIGHT`, `SQ`, `DQ` | **no** |
167
167
  | `OPEN-BRACKET`, `CLOSE-BRACKET` | **no** |
168
- | any literal matching list (`abbreviations`, `beforeUnits`, `hyphen.*`, the trademark table) | **no** — the marker never matches a literal |
168
+ | any literal matching list (`abbreviations`, `beforeUnits`, `spacedUnits`, `closedUnits`, `hyphen.*`, the trademark table) | **no** — the marker never matches a literal |
169
169
  | `OPENISH` **and** `CLOSEISH` (`quotes`, `apostrophe`) | **yes, both** |
170
170
  | `CLOSEISH` (`nbsp`) | **yes** |
171
171
  | `OPENISH` (`nbsp`), `OPENQUOTE` and `CLOSEDELIM` (`apostrophe`) | **no** |
@@ -272,7 +272,7 @@ special-casing**:
272
272
  | ----------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
273
273
  | `<em>foo </em>- bar` | `foo ⟦- bar` | `dashes`: the code point left of the dash is the marker, not a space, so `lsp = 0` while `rsp = 1` — the symmetry guard declines. Miss, not damage |
274
274
  | `He said <code>x</code> "hi"` | `He said ⟦ "hi"` | `spaces`: two runs of length 1 separated by the marker, not one run of 2. No collapse |
275
- | `5 <em>km</em>` | `5 ⟦km` | `nbsp` N5 requires `cp[a-1]` to be `SP` or `NBSP`; it is the marker. Declines |
275
+ | `5 <em>km</em>` | `5 ⟦km` | `nbsp` N5 needs `cp[a-1]` to be a separator or a `DIGIT` (§3.7 step 3); it is the marker, which is neither. Declines, so nothing is inserted or deleted |
276
276
  | `из<em>-под</em>` | `из⟦-под` | `hyphen`: no listed form matches across the marker. Declines |
277
277
  | `(c<em>)</em>` | `(c⟦)` | `symbols`: the literal `(c)` does not match. Declines |
278
278