@mailwoman/corpus 10.6.0 → 10.7.0

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 (223) hide show
  1. package/data/PROVENANCE.md +24 -0
  2. package/data/address-source-register.json +18948 -8757
  3. package/data/corpus-source-inputs.json +4756 -0
  4. package/data/license-decisions.json +7260 -0
  5. package/data/licenses/whosonfirst-licenses.md +3 -2
  6. package/data/reviewed-ve-postcode-tuples.json +5 -72
  7. package/data/source-additions.json +2450 -0
  8. package/data/source-resolutions.json +87 -0
  9. package/data/training-manifests/v0.7.10-gb-county.effective.json +2335 -0
  10. package/data/training-manifests/v0.7.10-gb-county.json +1132 -0
  11. package/data/training-manifests/v0.7.2-address-systems.effective.json +3 -2
  12. package/data/training-manifests/v0.7.7-no-ppd.json +550 -0
  13. package/data/training-manifests/v0.7.8-rights-clean.json +538 -0
  14. package/data/training-manifests/v0.7.9-country-gap.json +1132 -0
  15. package/data/us-situs-sources.json +128 -0
  16. package/lib/adapters/cordis/adapter.ts +1 -1
  17. package/lib/adapters/libpostal-dictionary.ts +23 -3
  18. package/lib/adapters/osm/adapter.ts +42 -11
  19. package/lib/adapters.ts +14 -0
  20. package/lib/az/adapters/opendata/adapter.ts +389 -0
  21. package/lib/bs/adapters/gbpa/adapter.ts +248 -0
  22. package/lib/build/types.ts +16 -0
  23. package/lib/build.ts +21 -0
  24. package/lib/ee/adapters/ads/adapter.ts +18 -0
  25. package/lib/fo/adapters/adressur/adapter.ts +242 -0
  26. package/lib/gb/adapters/os-open/adapter.ts +12 -0
  27. package/lib/gb/county.ts +59 -0
  28. package/lib/gb/os-open/open/names.ts +41 -0
  29. package/lib/gu/adapters/bsp/adapter.ts +434 -0
  30. package/lib/im/adapters/land-registry/adapter.ts +340 -0
  31. package/lib/international/recipes/locale.ts +164 -19
  32. package/lib/li/adapters/llv/adapter.ts +246 -0
  33. package/lib/recipes/bare/postcode.ts +10 -34
  34. package/lib/recipes/country-balanced.ts +95 -78
  35. package/lib/recipes/intersection.ts +22 -30
  36. package/lib/recipes/po/box/cedex/recipe.ts +8 -5
  37. package/lib/recipes/po/box/cedex/sources.ts +2 -23
  38. package/lib/recipes/scaffold.ts +28 -3
  39. package/lib/recipes/sources.ts +112 -1
  40. package/lib/recipes/street/affix.ts +17 -29
  41. package/lib/recipes/sub/venue/context.ts +33 -9
  42. package/lib/recipes/sub/venue/sources.ts +54 -13
  43. package/lib/recipes/sub/venue.ts +68 -23
  44. package/lib/recipes/unit.ts +20 -7
  45. package/lib/registers.ts +33 -0
  46. package/lib/source-register/corpus-inputs.ts +528 -0
  47. package/lib/source-register/effective-manifest.ts +37 -5
  48. package/lib/source-register/types.ts +20 -0
  49. package/lib/south-asia/recipes/register.ts +1 -1
  50. package/lib/tools/overlay/manifest.ts +109 -1
  51. package/lib/tools/source-register/build.ts +47 -1
  52. package/lib/tools/variety-sample.ts +633 -0
  53. package/lib/us/adapters/usgov/nad/adapter.ts +39 -10
  54. package/lib/us/recipes/skeleton-sources.ts +156 -0
  55. package/lib/us/tools/nad-skeletons.ts +395 -0
  56. package/lib/uy/adapters/ide/adapter.ts +275 -0
  57. package/lib/ve/recipes/reviewed-postcode-tail.ts +29 -6
  58. package/out/adapters/cordis/adapter.d.ts +1 -1
  59. package/out/adapters/cordis/adapter.js +1 -1
  60. package/out/adapters/libpostal-dictionary.d.ts +9 -0
  61. package/out/adapters/libpostal-dictionary.d.ts.map +1 -1
  62. package/out/adapters/libpostal-dictionary.js +19 -3
  63. package/out/adapters/libpostal-dictionary.js.map +1 -1
  64. package/out/adapters/osm/adapter.d.ts +12 -1
  65. package/out/adapters/osm/adapter.d.ts.map +1 -1
  66. package/out/adapters/osm/adapter.js +30 -13
  67. package/out/adapters/osm/adapter.js.map +1 -1
  68. package/out/adapters.d.ts.map +1 -1
  69. package/out/adapters.js +14 -0
  70. package/out/adapters.js.map +1 -1
  71. package/out/az/adapters/opendata/adapter.d.ts +88 -0
  72. package/out/az/adapters/opendata/adapter.d.ts.map +1 -0
  73. package/out/az/adapters/opendata/adapter.js +282 -0
  74. package/out/az/adapters/opendata/adapter.js.map +1 -0
  75. package/out/bs/adapters/gbpa/adapter.d.ts +64 -0
  76. package/out/bs/adapters/gbpa/adapter.d.ts.map +1 -0
  77. package/out/bs/adapters/gbpa/adapter.js +187 -0
  78. package/out/bs/adapters/gbpa/adapter.js.map +1 -0
  79. package/out/build/types.d.ts +15 -0
  80. package/out/build/types.d.ts.map +1 -1
  81. package/out/build/types.js.map +1 -1
  82. package/out/build.d.ts.map +1 -1
  83. package/out/build.js +17 -0
  84. package/out/build.js.map +1 -1
  85. package/out/ee/adapters/ads/adapter.d.ts +6 -0
  86. package/out/ee/adapters/ads/adapter.d.ts.map +1 -1
  87. package/out/ee/adapters/ads/adapter.js +16 -0
  88. package/out/ee/adapters/ads/adapter.js.map +1 -1
  89. package/out/fo/adapters/adressur/adapter.d.ts +63 -0
  90. package/out/fo/adapters/adressur/adapter.d.ts.map +1 -0
  91. package/out/fo/adapters/adressur/adapter.js +177 -0
  92. package/out/fo/adapters/adressur/adapter.js.map +1 -0
  93. package/out/gb/adapters/os-open/adapter.d.ts +8 -0
  94. package/out/gb/adapters/os-open/adapter.d.ts.map +1 -1
  95. package/out/gb/adapters/os-open/adapter.js +11 -0
  96. package/out/gb/adapters/os-open/adapter.js.map +1 -1
  97. package/out/gb/county.d.ts +30 -0
  98. package/out/gb/county.d.ts.map +1 -0
  99. package/out/gb/county.js +51 -0
  100. package/out/gb/county.js.map +1 -0
  101. package/out/gb/os-open/open/names.d.ts +17 -0
  102. package/out/gb/os-open/open/names.d.ts.map +1 -1
  103. package/out/gb/os-open/open/names.js +19 -0
  104. package/out/gb/os-open/open/names.js.map +1 -1
  105. package/out/gu/adapters/bsp/adapter.d.ts +83 -0
  106. package/out/gu/adapters/bsp/adapter.d.ts.map +1 -0
  107. package/out/gu/adapters/bsp/adapter.js +346 -0
  108. package/out/gu/adapters/bsp/adapter.js.map +1 -0
  109. package/out/im/adapters/land-registry/adapter.d.ts +68 -0
  110. package/out/im/adapters/land-registry/adapter.d.ts.map +1 -0
  111. package/out/im/adapters/land-registry/adapter.js +261 -0
  112. package/out/im/adapters/land-registry/adapter.js.map +1 -0
  113. package/out/international/recipes/locale.d.ts +24 -4
  114. package/out/international/recipes/locale.d.ts.map +1 -1
  115. package/out/international/recipes/locale.js +107 -15
  116. package/out/international/recipes/locale.js.map +1 -1
  117. package/out/li/adapters/llv/adapter.d.ts +69 -0
  118. package/out/li/adapters/llv/adapter.d.ts.map +1 -0
  119. package/out/li/adapters/llv/adapter.js +181 -0
  120. package/out/li/adapters/llv/adapter.js.map +1 -0
  121. package/out/recipes/bare/postcode.d.ts.map +1 -1
  122. package/out/recipes/bare/postcode.js +9 -30
  123. package/out/recipes/bare/postcode.js.map +1 -1
  124. package/out/recipes/country-balanced.d.ts.map +1 -1
  125. package/out/recipes/country-balanced.js +82 -73
  126. package/out/recipes/country-balanced.js.map +1 -1
  127. package/out/recipes/intersection.d.ts +3 -2
  128. package/out/recipes/intersection.d.ts.map +1 -1
  129. package/out/recipes/intersection.js +20 -26
  130. package/out/recipes/intersection.js.map +1 -1
  131. package/out/recipes/po/box/cedex/recipe.d.ts.map +1 -1
  132. package/out/recipes/po/box/cedex/recipe.js +5 -4
  133. package/out/recipes/po/box/cedex/recipe.js.map +1 -1
  134. package/out/recipes/po/box/cedex/sources.d.ts +2 -45
  135. package/out/recipes/po/box/cedex/sources.d.ts.map +1 -1
  136. package/out/recipes/po/box/cedex/sources.js +0 -20
  137. package/out/recipes/po/box/cedex/sources.js.map +1 -1
  138. package/out/recipes/scaffold.d.ts +15 -2
  139. package/out/recipes/scaffold.d.ts.map +1 -1
  140. package/out/recipes/scaffold.js +21 -1
  141. package/out/recipes/scaffold.js.map +1 -1
  142. package/out/recipes/sources.d.ts.map +1 -1
  143. package/out/recipes/sources.js +112 -1
  144. package/out/recipes/sources.js.map +1 -1
  145. package/out/recipes/street/affix.d.ts.map +1 -1
  146. package/out/recipes/street/affix.js +8 -20
  147. package/out/recipes/street/affix.js.map +1 -1
  148. package/out/recipes/sub/venue/context.d.ts +14 -3
  149. package/out/recipes/sub/venue/context.d.ts.map +1 -1
  150. package/out/recipes/sub/venue/context.js +29 -9
  151. package/out/recipes/sub/venue/context.js.map +1 -1
  152. package/out/recipes/sub/venue/sources.d.ts +41 -8
  153. package/out/recipes/sub/venue/sources.d.ts.map +1 -1
  154. package/out/recipes/sub/venue/sources.js +26 -7
  155. package/out/recipes/sub/venue/sources.js.map +1 -1
  156. package/out/recipes/sub/venue.d.ts.map +1 -1
  157. package/out/recipes/sub/venue.js +35 -14
  158. package/out/recipes/sub/venue.js.map +1 -1
  159. package/out/recipes/unit.d.ts +4 -0
  160. package/out/recipes/unit.d.ts.map +1 -1
  161. package/out/recipes/unit.js +7 -6
  162. package/out/recipes/unit.js.map +1 -1
  163. package/out/registers.d.ts +33 -0
  164. package/out/registers.d.ts.map +1 -1
  165. package/out/registers.js +33 -0
  166. package/out/registers.js.map +1 -1
  167. package/out/source-register/corpus-inputs.d.ts +240 -0
  168. package/out/source-register/corpus-inputs.d.ts.map +1 -0
  169. package/out/source-register/corpus-inputs.js +275 -0
  170. package/out/source-register/corpus-inputs.js.map +1 -0
  171. package/out/source-register/effective-manifest.d.ts +2 -0
  172. package/out/source-register/effective-manifest.d.ts.map +1 -1
  173. package/out/source-register/effective-manifest.js +33 -4
  174. package/out/source-register/effective-manifest.js.map +1 -1
  175. package/out/source-register/types.d.ts +21 -1
  176. package/out/source-register/types.d.ts.map +1 -1
  177. package/out/source-register/types.js +20 -0
  178. package/out/source-register/types.js.map +1 -1
  179. package/out/south-asia/recipes/register.js +1 -1
  180. package/out/south-asia/recipes/register.js.map +1 -1
  181. package/out/tools/overlay/manifest.d.ts +7 -0
  182. package/out/tools/overlay/manifest.d.ts.map +1 -1
  183. package/out/tools/overlay/manifest.js +72 -1
  184. package/out/tools/overlay/manifest.js.map +1 -1
  185. package/out/tools/source-register/build.d.ts +9 -0
  186. package/out/tools/source-register/build.d.ts.map +1 -1
  187. package/out/tools/source-register/build.js +25 -3
  188. package/out/tools/source-register/build.js.map +1 -1
  189. package/out/tools/variety-sample.d.ts +196 -0
  190. package/out/tools/variety-sample.d.ts.map +1 -0
  191. package/out/tools/variety-sample.js +417 -0
  192. package/out/tools/variety-sample.js.map +1 -0
  193. package/out/us/adapters/usgov/nad/adapter.d.ts +80 -0
  194. package/out/us/adapters/usgov/nad/adapter.d.ts.map +1 -1
  195. package/out/us/adapters/usgov/nad/adapter.js +27 -8
  196. package/out/us/adapters/usgov/nad/adapter.js.map +1 -1
  197. package/out/us/recipes/skeleton-sources.d.ts +92 -0
  198. package/out/us/recipes/skeleton-sources.d.ts.map +1 -0
  199. package/out/us/recipes/skeleton-sources.js +121 -0
  200. package/out/us/recipes/skeleton-sources.js.map +1 -0
  201. package/out/us/tools/nad-skeletons.d.ts +120 -0
  202. package/out/us/tools/nad-skeletons.d.ts.map +1 -0
  203. package/out/us/tools/nad-skeletons.js +262 -0
  204. package/out/us/tools/nad-skeletons.js.map +1 -0
  205. package/out/uy/adapters/ide/adapter.d.ts +64 -0
  206. package/out/uy/adapters/ide/adapter.d.ts.map +1 -0
  207. package/out/uy/adapters/ide/adapter.js +206 -0
  208. package/out/uy/adapters/ide/adapter.js.map +1 -0
  209. package/out/ve/recipes/reviewed-postcode-tail.d.ts +6 -2
  210. package/out/ve/recipes/reviewed-postcode-tail.d.ts.map +1 -1
  211. package/out/ve/recipes/reviewed-postcode-tail.js +16 -5
  212. package/out/ve/recipes/reviewed-postcode-tail.js.map +1 -1
  213. package/package.json +14 -14
  214. package/lib/recipes/unit/sources.ts +0 -44
  215. package/lib/tools/fetch/ppd.ts +0 -121
  216. package/out/recipes/unit/sources.d.ts +0 -28
  217. package/out/recipes/unit/sources.d.ts.map +0 -1
  218. package/out/recipes/unit/sources.js +0 -30
  219. package/out/recipes/unit/sources.js.map +0 -1
  220. package/out/tools/fetch/ppd.d.ts +0 -15
  221. package/out/tools/fetch/ppd.d.ts.map +0 -1
  222. package/out/tools/fetch/ppd.js +0 -86
  223. package/out/tools/fetch/ppd.js.map +0 -1
@@ -0,0 +1,196 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Draws a country's training rows from a complete adapter output so the sample spans the country's address forms
7
+ * rather than its densest streets, and measures the variety of both.
8
+ *
9
+ * An address source lists one house after another: a city street contributes every number along it, and a city
10
+ * contributes thousands of such streets. A model trained on that order sees the same street, locality and form
11
+ * repeated. The sample here keeps at most a few rows per street and at most a fixed number per place (a locality
12
+ * with its dependent locality), and fills each place round-robin across its forms (which components are present,
13
+ * the street type, the script) and its postcodes. Places are then filled in rounds, so every place is represented
14
+ * once before any is represented twice, until the country's ceiling. The ceiling keeps one country from dominating
15
+ * a mixture.
16
+ *
17
+ * The adapter output stays complete beside the sample, because the same rows feed retrieval.
18
+ */
19
+ import { type PathBuilderLike } from "path-ts";
20
+ import type { CanonicalRow } from "#types";
21
+ /**
22
+ * The script most of `text`'s letters are written in, or `Other` when none
23
+ * of {@link SCRIPTS} holds a letter.
24
+ */
25
+ export declare function dominantScript(text: string): string;
26
+ /**
27
+ * The street-type forms a country's addresses use, each mapped to its canonical
28
+ * spelling, and which lexicon supplied them.
29
+ */
30
+ export interface StreetTypeLexicon {
31
+ readonly forms: ReadonlyMap<string, string>;
32
+ /**
33
+ * The libpostal languages read: the country's official languages that have a `street_types.txt`,
34
+ * or `all` when none does and every language's list was read instead.
35
+ */
36
+ readonly languages: readonly string[] | "all";
37
+ }
38
+ /**
39
+ * The libpostal street-type lexicon for `country`'s official languages.
40
+ *
41
+ * A country whose official languages have no libpostal list (Armenian, Uzbek, Kyrgyz) reads
42
+ * every language's list, so a street written in a neighbor's language still counts its type.
43
+ */
44
+ export declare function loadStreetTypeLexicon(country: string): Promise<StreetTypeLexicon>;
45
+ /**
46
+ * The canonical street type a street name carries, read from its first or last one or two words, or null.
47
+ */
48
+ export declare function streetTypeOf(street: string, lexicon: StreetTypeLexicon): string | null;
49
+ /**
50
+ * What one row contributes to a variety census.
51
+ */
52
+ export interface RowVariety {
53
+ readonly locality: string;
54
+ readonly dependentLocality: string | null;
55
+ /**
56
+ * The locality and the dependent locality together: the settlement a row is stratified by.
57
+ */
58
+ readonly place: string;
59
+ readonly postcode: string | null;
60
+ readonly street: string | null;
61
+ readonly streetType: string | null;
62
+ readonly hasUnit: boolean;
63
+ readonly hasDependentLocality: boolean;
64
+ readonly hasVenue: boolean;
65
+ readonly streetless: boolean;
66
+ readonly script: string;
67
+ /**
68
+ * The components present, the street type and the script, joined: the row's form.
69
+ */
70
+ readonly form: string;
71
+ }
72
+ /**
73
+ * Reads one canonical row's variety keys.
74
+ *
75
+ * The locality is the row's `locality`, else its `dependent_locality`, else its `region`,
76
+ * so a streetless premise in a named place is stratified by that place.
77
+ * The place a row is stratified by joins the dependent locality to it, so an Estonian village is
78
+ * its own place rather than one of its municipality's, and a city's districts are each their own.
79
+ */
80
+ export declare function rowVariety(row: Pick<CanonicalRow, "components" | "raw">, lexicon: StreetTypeLexicon): RowVariety;
81
+ /**
82
+ * The variety measures of a set of rows.
83
+ */
84
+ export interface VarietyMeasures {
85
+ rows: number;
86
+ localities: number;
87
+ dependentLocalities: number;
88
+ /**
89
+ * Distinct locality and dependent-locality pairs.
90
+ */
91
+ places: number;
92
+ postcodes: number;
93
+ streets: number;
94
+ streetTypes: number;
95
+ forms: number;
96
+ unitShare: number;
97
+ dependentLocalityShare: number;
98
+ venueShare: number;
99
+ streetlessShare: number;
100
+ postcodeShare: number;
101
+ scripts: Record<string, number>;
102
+ /**
103
+ * The share of rows in the largest locality, a measure of how concentrated the rows are.
104
+ */
105
+ largestLocalityShare: number;
106
+ }
107
+ /**
108
+ * Accumulates {@link VarietyMeasures} one row at a time.
109
+ */
110
+ export declare class VarietyCensus {
111
+ #private;
112
+ add(variety: RowVariety): void;
113
+ measures(): VarietyMeasures;
114
+ }
115
+ /**
116
+ * The limits a variety sample is drawn under.
117
+ */
118
+ export interface VarietySampleLimits {
119
+ /**
120
+ * The most rows kept from one street in one locality.
121
+ */
122
+ perStreet: number;
123
+ /**
124
+ * The most rows kept from one place, a locality and dependent-locality pair.
125
+ */
126
+ perPlace: number;
127
+ /**
128
+ * The most rows kept for the country.
129
+ */
130
+ ceiling: number;
131
+ seed: number;
132
+ }
133
+ /**
134
+ * The selection key of one row: interned ids, so a country's rows fit in memory as integers.
135
+ */
136
+ export interface SelectionKey {
137
+ readonly place: number;
138
+ readonly street: number;
139
+ readonly form: number;
140
+ readonly postcode: number;
141
+ }
142
+ /**
143
+ * Chooses the row indices of a variety sample.
144
+ *
145
+ * Rows are visited in a seeded random order.
146
+ * A street keeps its first {@link VarietySampleLimits.perStreet} rows.
147
+ *
148
+ * Within a place the kept rows are interleaved across forms, and within a form across postcodes,
149
+ * and the first {@link VarietySampleLimits.perPlace} are the place's candidates.
150
+ * Candidates are then taken by their rank within their place, lowest first, so every place supplies
151
+ * its first row before any supplies its second, until {@link VarietySampleLimits.ceiling}.
152
+ * The returned indices are ascending.
153
+ */
154
+ export declare function selectVarietySample(keys: readonly SelectionKey[], limits: VarietySampleLimits): number[];
155
+ /**
156
+ * What a variety-sample run read, wrote and measured.
157
+ */
158
+ export interface VarietySampleReport {
159
+ input: string;
160
+ inputSHA256: string;
161
+ output: string;
162
+ outputSHA256: string;
163
+ country: string;
164
+ limits: VarietySampleLimits;
165
+ streetTypeLanguages: readonly string[] | "all";
166
+ /**
167
+ * Lines that did not parse as a canonical row of the requested country.
168
+ */
169
+ skipped: Record<string, number>;
170
+ full: VarietyMeasures;
171
+ sample: VarietyMeasures;
172
+ /**
173
+ * The share of the full output's distinct values the sample keeps.
174
+ */
175
+ coverage: {
176
+ localities: number;
177
+ places: number;
178
+ postcodes: number;
179
+ streetTypes: number;
180
+ forms: number;
181
+ };
182
+ }
183
+ /**
184
+ * Reads a complete adapter output, writes its variety sample to `output` and the
185
+ * report beside it as `<output>.variety.json`, and returns the report.
186
+ *
187
+ * The input is read twice, once to key every row and once to copy the chosen lines,
188
+ * so memory holds integers per row rather than the rows themselves.
189
+ */
190
+ export declare function writeVarietySample(options: {
191
+ input: PathBuilderLike;
192
+ output: PathBuilderLike;
193
+ country: string;
194
+ limits: VarietySampleLimits;
195
+ }): Promise<VarietySampleReport>;
196
+ //# sourceMappingURL=variety-sample.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variety-sample.d.ts","sourceRoot":"","sources":["../../lib/tools/variety-sample.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AASH,OAAO,EAAE,KAAK,eAAe,EAAe,MAAM,SAAS,CAAA;AAK3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAqB1C;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAsBnD;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC3C;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,KAAK,CAAA;CAC7C;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CA+BvF;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAyBtF;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;IACzC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,QAAQ,EA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AAO,EAAE;IACjD,KAAK,EAAE,eAAe,CAAA;IACtB,MAAM,EAAE,eAAe,CAAA;IACvB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,mBAAmB,CAAA;CAC3B,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAoH/B"}
@@ -0,0 +1,417 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Draws a country's training rows from a complete adapter output so the sample spans the country's address forms
7
+ * rather than its densest streets, and measures the variety of both.
8
+ *
9
+ * An address source lists one house after another: a city street contributes every number along it, and a city
10
+ * contributes thousands of such streets. A model trained on that order sees the same street, locality and form
11
+ * repeated. The sample here keeps at most a few rows per street and at most a fixed number per place (a locality
12
+ * with its dependent locality), and fills each place round-robin across its forms (which components are present,
13
+ * the street type, the script) and its postcodes. Places are then filled in rounds, so every place is represented
14
+ * once before any is represented twice, until the country's ceiling. The ceiling keeps one country from dominating
15
+ * a mixture.
16
+ *
17
+ * The adapter output stays complete beside the sample, because the same rows feed retrieval.
18
+ */
19
+ import { OFFICIAL_LANGUAGES } from "@mailwoman/codex/country/official-languages";
20
+ import { pathExists } from "@mailwoman/core/fs/readers/stat";
21
+ import { writeLocalJSONFile, writeLocalTextFile } from "@mailwoman/core/fs/writers";
22
+ import { sha256File } from "@mailwoman/core/hash";
23
+ import { tryParsingJSON } from "@mailwoman/core/json";
24
+ import { resourceDictionaryPath } from "@mailwoman/core/paths";
25
+ import { mulberry32, shuffleWith } from "@mailwoman/core/random";
26
+ import { resolvePath } from "path-ts";
27
+ import { TextSpliterator } from "spliterator";
28
+ import { Globerator } from "spliterator/node/fs";
29
+ import { loadLibpostalCanonicalForms } from "#adapters/libpostal-dictionary";
30
+ /**
31
+ * The scripts a row's letters are classified into, in the order a tie is broken.
32
+ */
33
+ const SCRIPTS = [
34
+ "Latin",
35
+ "Cyrillic",
36
+ "Arabic",
37
+ "Armenian",
38
+ "Georgian",
39
+ "Greek",
40
+ "Hebrew",
41
+ "Han",
42
+ "Hangul",
43
+ "Thai",
44
+ "Devanagari",
45
+ ];
46
+ const SCRIPT_PATTERNS = SCRIPTS.map((script) => [script, new RegExp(`\\p{Script=${script}}`, "u")]);
47
+ /**
48
+ * The script most of `text`'s letters are written in, or `Other` when none
49
+ * of {@link SCRIPTS} holds a letter.
50
+ */
51
+ export function dominantScript(text) {
52
+ const counts = new Map();
53
+ for (const character of text) {
54
+ if (!/\p{L}/u.test(character))
55
+ continue;
56
+ const script = SCRIPT_PATTERNS.find(([, pattern]) => pattern.test(character))?.[0] ?? "Other";
57
+ counts.set(script, (counts.get(script) ?? 0) + 1);
58
+ }
59
+ let best = "Other";
60
+ let most = 0;
61
+ for (const [script, count] of counts) {
62
+ if (count > most) {
63
+ best = script;
64
+ most = count;
65
+ }
66
+ }
67
+ return best;
68
+ }
69
+ /**
70
+ * The libpostal street-type lexicon for `country`'s official languages.
71
+ *
72
+ * A country whose official languages have no libpostal list (Armenian, Uzbek, Kyrgyz) reads
73
+ * every language's list, so a street written in a neighbor's language still counts its type.
74
+ */
75
+ export async function loadStreetTypeLexicon(country) {
76
+ const official = (OFFICIAL_LANGUAGES[country.toUpperCase()]?.official ?? []).filter((code) => code.length === 2);
77
+ const available = [];
78
+ for (const language of official) {
79
+ if (await pathExists(resourceDictionaryPath("libpostal", language, "street_types.txt"))) {
80
+ available.push(language);
81
+ }
82
+ }
83
+ const every = async () => {
84
+ const files = await Globerator.from("*/street_types.txt", {
85
+ cwd: resourceDictionaryPath("libpostal").toString(),
86
+ absolute: false,
87
+ }).toSorted();
88
+ return files.map((file) => file.split("/")[0]);
89
+ };
90
+ const languages = available.length ? available : await every();
91
+ const forms = new Map();
92
+ for (const language of languages) {
93
+ for (const [form, canonical] of await loadLibpostalCanonicalForms(language, "street_types.txt")) {
94
+ if (form && !forms.has(form)) {
95
+ forms.set(form, `${language}:${canonical}`);
96
+ }
97
+ }
98
+ }
99
+ return { forms, languages: available.length ? available : "all" };
100
+ }
101
+ /**
102
+ * The canonical street type a street name carries, read from its first or last one or two words, or null.
103
+ */
104
+ export function streetTypeOf(street, lexicon) {
105
+ const words = street
106
+ .toLowerCase()
107
+ .split(/\s+/u)
108
+ .map((word) => word.replaceAll(/^[\p{P}\p{S}]+|[,;:]+$/gu, ""))
109
+ .filter((word) => word.length > 0);
110
+ if (!words.length)
111
+ return null;
112
+ const candidates = [
113
+ words.slice(0, 2).join(" "),
114
+ words.slice(-2).join(" "),
115
+ words[0],
116
+ words.at(-1),
117
+ words[0].replace(/\.$/u, ""),
118
+ words.at(-1).replace(/\.$/u, ""),
119
+ ];
120
+ for (const candidate of candidates) {
121
+ const canonical = lexicon.forms.get(candidate);
122
+ if (canonical)
123
+ return canonical;
124
+ }
125
+ return null;
126
+ }
127
+ /**
128
+ * Reads one canonical row's variety keys.
129
+ *
130
+ * The locality is the row's `locality`, else its `dependent_locality`, else its `region`,
131
+ * so a streetless premise in a named place is stratified by that place.
132
+ * The place a row is stratified by joins the dependent locality to it, so an Estonian village is
133
+ * its own place rather than one of its municipality's, and a city's districts are each their own.
134
+ */
135
+ export function rowVariety(row, lexicon) {
136
+ const { components } = row;
137
+ const street = components.street?.trim() || null;
138
+ const streetType = street ? streetTypeOf(street, lexicon) : null;
139
+ const script = dominantScript(row.raw);
140
+ const tags = Object.keys(components)
141
+ .filter((tag) => components[tag])
142
+ .toSorted();
143
+ const locality = components.locality ?? components.dependent_locality ?? components.region ?? "";
144
+ const dependentLocality = components.dependent_locality ?? null;
145
+ return {
146
+ locality,
147
+ dependentLocality,
148
+ place: `${locality}\u0000${dependentLocality ?? ""}`,
149
+ postcode: components.postcode ?? null,
150
+ street,
151
+ streetType,
152
+ hasUnit: Boolean(components.unit),
153
+ hasDependentLocality: Boolean(components.dependent_locality),
154
+ hasVenue: Boolean(components.venue),
155
+ streetless: !street,
156
+ script,
157
+ form: `${tags.join("+")}|${streetType ?? "-"}|${script}`,
158
+ };
159
+ }
160
+ /**
161
+ * Accumulates {@link VarietyMeasures} one row at a time.
162
+ */
163
+ export class VarietyCensus {
164
+ #rows = 0;
165
+ #units = 0;
166
+ #dependent = 0;
167
+ #venues = 0;
168
+ #streetless = 0;
169
+ #withPostcode = 0;
170
+ #localities = new Map();
171
+ #dependentLocalities = new Set();
172
+ #places = new Set();
173
+ #postcodes = new Set();
174
+ #streets = new Set();
175
+ #streetTypes = new Set();
176
+ #forms = new Set();
177
+ #scripts = new Map();
178
+ add(variety) {
179
+ this.#rows++;
180
+ this.#localities.set(variety.locality, (this.#localities.get(variety.locality) ?? 0) + 1);
181
+ this.#places.add(variety.place);
182
+ if (variety.dependentLocality) {
183
+ this.#dependentLocalities.add(`${variety.locality}\u0000${variety.dependentLocality}`);
184
+ }
185
+ if (variety.postcode) {
186
+ this.#withPostcode++;
187
+ this.#postcodes.add(variety.postcode);
188
+ }
189
+ if (variety.street) {
190
+ this.#streets.add(`${variety.locality}\u0000${variety.street}`);
191
+ }
192
+ if (variety.streetType) {
193
+ this.#streetTypes.add(variety.streetType);
194
+ }
195
+ this.#forms.add(variety.form);
196
+ this.#scripts.set(variety.script, (this.#scripts.get(variety.script) ?? 0) + 1);
197
+ if (variety.hasUnit) {
198
+ this.#units++;
199
+ }
200
+ if (variety.hasDependentLocality) {
201
+ this.#dependent++;
202
+ }
203
+ if (variety.hasVenue) {
204
+ this.#venues++;
205
+ }
206
+ if (variety.streetless) {
207
+ this.#streetless++;
208
+ }
209
+ }
210
+ measures() {
211
+ const share = (count) => (this.#rows ? Number((count / this.#rows).toFixed(4)) : 0);
212
+ let largestLocality = 0;
213
+ for (const count of this.#localities.values()) {
214
+ largestLocality = Math.max(largestLocality, count);
215
+ }
216
+ return {
217
+ rows: this.#rows,
218
+ localities: this.#localities.size,
219
+ dependentLocalities: this.#dependentLocalities.size,
220
+ places: this.#places.size,
221
+ postcodes: this.#postcodes.size,
222
+ streets: this.#streets.size,
223
+ streetTypes: this.#streetTypes.size,
224
+ forms: this.#forms.size,
225
+ unitShare: share(this.#units),
226
+ dependentLocalityShare: share(this.#dependent),
227
+ venueShare: share(this.#venues),
228
+ streetlessShare: share(this.#streetless),
229
+ postcodeShare: share(this.#withPostcode),
230
+ scripts: Object.fromEntries([...this.#scripts].toSorted((a, b) => b[1] - a[1])),
231
+ largestLocalityShare: share(largestLocality),
232
+ };
233
+ }
234
+ }
235
+ /**
236
+ * Groups `items` by the key `groupOf` assigns, in first-seen order.
237
+ */
238
+ function groupBy(items, groupOf) {
239
+ const groups = new Map();
240
+ for (const item of items) {
241
+ const key = groupOf(item);
242
+ let group = groups.get(key);
243
+ if (!group) {
244
+ groups.set(key, (group = []));
245
+ }
246
+ group.push(item);
247
+ }
248
+ return [...groups.values()];
249
+ }
250
+ /**
251
+ * Interleaves `lists`, the first item of each and then the second of each,
252
+ * until every list is spent or `limit` items are taken.
253
+ */
254
+ function interleave(lists, limit) {
255
+ const ordered = [];
256
+ const total = Math.min(limit, lists.reduce((sum, list) => sum + list.length, 0));
257
+ for (let round = 0; ordered.length < total; round++) {
258
+ for (const list of lists) {
259
+ if (round < list.length && ordered.length < total) {
260
+ ordered.push(list[round]);
261
+ }
262
+ }
263
+ }
264
+ return ordered;
265
+ }
266
+ /**
267
+ * Chooses the row indices of a variety sample.
268
+ *
269
+ * Rows are visited in a seeded random order.
270
+ * A street keeps its first {@link VarietySampleLimits.perStreet} rows.
271
+ *
272
+ * Within a place the kept rows are interleaved across forms, and within a form across postcodes,
273
+ * and the first {@link VarietySampleLimits.perPlace} are the place's candidates.
274
+ * Candidates are then taken by their rank within their place, lowest first, so every place supplies
275
+ * its first row before any supplies its second, until {@link VarietySampleLimits.ceiling}.
276
+ * The returned indices are ascending.
277
+ */
278
+ export function selectVarietySample(keys, limits) {
279
+ const order = keys.map((_, index) => index);
280
+ shuffleWith(order, mulberry32(limits.seed));
281
+ const perStreet = new Map();
282
+ const byPlace = new Map();
283
+ for (const index of order) {
284
+ const key = keys[index];
285
+ const kept = perStreet.get(key.street) ?? 0;
286
+ if (kept >= limits.perStreet)
287
+ continue;
288
+ perStreet.set(key.street, kept + 1);
289
+ let rows = byPlace.get(key.place);
290
+ if (!rows) {
291
+ byPlace.set(key.place, (rows = []));
292
+ }
293
+ rows.push(index);
294
+ }
295
+ // Candidates bucketed by rank within their place.
296
+ // The places' order is the shuffled first-seen order, so the partial last
297
+ // round is a seeded draw across places.
298
+ const byRank = [];
299
+ for (const rows of byPlace.values()) {
300
+ // Forms take turns, and within a form its postcodes take turns, so a rare form such as a unit row
301
+ // is drawn as early as the common one and a form's rows spread across the place's postcodes.
302
+ const forms = groupBy(rows, (index) => keys[index].form).map((formRows) => interleave(groupBy(formRows, (index) => keys[index].postcode), limits.perPlace));
303
+ const ranked = interleave(forms, limits.perPlace);
304
+ for (const [rank, index] of ranked.entries()) {
305
+ ;
306
+ (byRank[rank] ??= []).push(index);
307
+ }
308
+ }
309
+ const chosen = [];
310
+ for (const bucket of byRank) {
311
+ if (chosen.length >= limits.ceiling)
312
+ break;
313
+ chosen.push(...bucket.slice(0, limits.ceiling - chosen.length));
314
+ }
315
+ return chosen.toSorted((a, b) => a - b);
316
+ }
317
+ /**
318
+ * Reads a complete adapter output, writes its variety sample to `output` and the
319
+ * report beside it as `<output>.variety.json`, and returns the report.
320
+ *
321
+ * The input is read twice, once to key every row and once to copy the chosen lines,
322
+ * so memory holds integers per row rather than the rows themselves.
323
+ */
324
+ export async function writeVarietySample(options) {
325
+ const { input, output, limits } = options;
326
+ const country = options.country.toUpperCase();
327
+ const lexicon = await loadStreetTypeLexicon(country);
328
+ const intern = () => {
329
+ const ids = new Map();
330
+ return (value) => {
331
+ let id = ids.get(value);
332
+ if (typeof id !== "number") {
333
+ ids.set(value, (id = ids.size));
334
+ }
335
+ return id;
336
+ };
337
+ };
338
+ const placeID = intern();
339
+ const streetID = intern();
340
+ const formID = intern();
341
+ const postcodeID = intern();
342
+ const keys = [];
343
+ const lineOfKey = [];
344
+ const full = new VarietyCensus();
345
+ const varieties = [];
346
+ const skipped = {};
347
+ let line = -1;
348
+ for await (const text of TextSpliterator.fromAsync(input)) {
349
+ line++;
350
+ if (!text.trim())
351
+ continue;
352
+ const row = tryParsingJSON(text);
353
+ if (!row || typeof row !== "object" || !row.components || typeof row.raw !== "string") {
354
+ skipped["unparseable"] = (skipped["unparseable"] ?? 0) + 1;
355
+ continue;
356
+ }
357
+ if (row.country !== country) {
358
+ skipped[`country:${row.country}`] = (skipped[`country:${row.country}`] ?? 0) + 1;
359
+ continue;
360
+ }
361
+ const variety = rowVariety(row, lexicon);
362
+ full.add(variety);
363
+ varieties.push(variety);
364
+ lineOfKey.push(line);
365
+ keys.push({
366
+ place: placeID(variety.place),
367
+ // A streetless premise numbered within a place repeats that place as a street's
368
+ // houses repeat the street, so the place is its street.
369
+ // A named site (an Estonian farm) is its own name, as a street is.
370
+ street: streetID(`${variety.place}\u0001${variety.street ?? row.components.venue ?? ""}`),
371
+ form: formID(variety.form),
372
+ postcode: postcodeID(variety.postcode ?? ""),
373
+ });
374
+ }
375
+ const chosen = selectVarietySample(keys, limits);
376
+ const sample = new VarietyCensus();
377
+ const chosenLines = new Set();
378
+ for (const index of chosen) {
379
+ sample.add(varieties[index]);
380
+ chosenLines.add(lineOfKey[index]);
381
+ }
382
+ async function* selectedLines() {
383
+ let current = -1;
384
+ for await (const text of TextSpliterator.fromAsync(input)) {
385
+ current++;
386
+ if (chosenLines.has(current)) {
387
+ yield text;
388
+ }
389
+ }
390
+ }
391
+ await writeLocalTextFile(selectedLines(), output);
392
+ const fullMeasures = full.measures();
393
+ const sampleMeasures = sample.measures();
394
+ const ratio = (kept, total) => (total ? Number((kept / total).toFixed(4)) : 0);
395
+ const report = {
396
+ input: resolvePath(input),
397
+ inputSHA256: await sha256File(input),
398
+ output: resolvePath(output),
399
+ outputSHA256: await sha256File(output),
400
+ country,
401
+ limits,
402
+ streetTypeLanguages: lexicon.languages,
403
+ skipped,
404
+ full: fullMeasures,
405
+ sample: sampleMeasures,
406
+ coverage: {
407
+ localities: ratio(sampleMeasures.localities, fullMeasures.localities),
408
+ places: ratio(sampleMeasures.places, fullMeasures.places),
409
+ postcodes: ratio(sampleMeasures.postcodes, fullMeasures.postcodes),
410
+ streetTypes: ratio(sampleMeasures.streetTypes, fullMeasures.streetTypes),
411
+ forms: ratio(sampleMeasures.forms, fullMeasures.forms),
412
+ },
413
+ };
414
+ await writeLocalJSONFile(report, `${resolvePath(output)}.variety.json`);
415
+ return report;
416
+ }
417
+ //# sourceMappingURL=variety-sample.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variety-sample.js","sourceRoot":"","sources":["../../lib/tools/variety-sample.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAA;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAC5D,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAChE,OAAO,EAAwB,WAAW,EAAE,MAAM,SAAS,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAEhD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAA;AAG5E;;GAEG;AACH,MAAM,OAAO,GAAG;IACf,OAAO;IACP,UAAU;IACV,QAAQ;IACR,UAAU;IACV,UAAU;IACV,OAAO;IACP,QAAQ;IACR,KAAK;IACL,QAAQ;IACR,MAAM;IACN,YAAY;CACH,CAAA;AAEV,MAAM,eAAe,GAAG,OAAO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