@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.
- package/data/PROVENANCE.md +24 -0
- package/data/address-source-register.json +18948 -8757
- package/data/corpus-source-inputs.json +4756 -0
- package/data/license-decisions.json +7260 -0
- package/data/licenses/whosonfirst-licenses.md +3 -2
- package/data/reviewed-ve-postcode-tuples.json +5 -72
- package/data/source-additions.json +2450 -0
- package/data/source-resolutions.json +87 -0
- package/data/training-manifests/v0.7.10-gb-county.effective.json +2335 -0
- package/data/training-manifests/v0.7.10-gb-county.json +1132 -0
- package/data/training-manifests/v0.7.2-address-systems.effective.json +3 -2
- package/data/training-manifests/v0.7.7-no-ppd.json +550 -0
- package/data/training-manifests/v0.7.8-rights-clean.json +538 -0
- package/data/training-manifests/v0.7.9-country-gap.json +1132 -0
- package/data/us-situs-sources.json +128 -0
- package/lib/adapters/cordis/adapter.ts +1 -1
- package/lib/adapters/libpostal-dictionary.ts +23 -3
- package/lib/adapters/osm/adapter.ts +42 -11
- package/lib/adapters.ts +14 -0
- package/lib/az/adapters/opendata/adapter.ts +389 -0
- package/lib/bs/adapters/gbpa/adapter.ts +248 -0
- package/lib/build/types.ts +16 -0
- package/lib/build.ts +21 -0
- package/lib/ee/adapters/ads/adapter.ts +18 -0
- package/lib/fo/adapters/adressur/adapter.ts +242 -0
- package/lib/gb/adapters/os-open/adapter.ts +12 -0
- package/lib/gb/county.ts +59 -0
- package/lib/gb/os-open/open/names.ts +41 -0
- package/lib/gu/adapters/bsp/adapter.ts +434 -0
- package/lib/im/adapters/land-registry/adapter.ts +340 -0
- package/lib/international/recipes/locale.ts +164 -19
- package/lib/li/adapters/llv/adapter.ts +246 -0
- package/lib/recipes/bare/postcode.ts +10 -34
- package/lib/recipes/country-balanced.ts +95 -78
- package/lib/recipes/intersection.ts +22 -30
- package/lib/recipes/po/box/cedex/recipe.ts +8 -5
- package/lib/recipes/po/box/cedex/sources.ts +2 -23
- package/lib/recipes/scaffold.ts +28 -3
- package/lib/recipes/sources.ts +112 -1
- package/lib/recipes/street/affix.ts +17 -29
- package/lib/recipes/sub/venue/context.ts +33 -9
- package/lib/recipes/sub/venue/sources.ts +54 -13
- package/lib/recipes/sub/venue.ts +68 -23
- package/lib/recipes/unit.ts +20 -7
- package/lib/registers.ts +33 -0
- package/lib/source-register/corpus-inputs.ts +528 -0
- package/lib/source-register/effective-manifest.ts +37 -5
- package/lib/source-register/types.ts +20 -0
- package/lib/south-asia/recipes/register.ts +1 -1
- package/lib/tools/overlay/manifest.ts +109 -1
- package/lib/tools/source-register/build.ts +47 -1
- package/lib/tools/variety-sample.ts +633 -0
- package/lib/us/adapters/usgov/nad/adapter.ts +39 -10
- package/lib/us/recipes/skeleton-sources.ts +156 -0
- package/lib/us/tools/nad-skeletons.ts +395 -0
- package/lib/uy/adapters/ide/adapter.ts +275 -0
- package/lib/ve/recipes/reviewed-postcode-tail.ts +29 -6
- package/out/adapters/cordis/adapter.d.ts +1 -1
- package/out/adapters/cordis/adapter.js +1 -1
- package/out/adapters/libpostal-dictionary.d.ts +9 -0
- package/out/adapters/libpostal-dictionary.d.ts.map +1 -1
- package/out/adapters/libpostal-dictionary.js +19 -3
- package/out/adapters/libpostal-dictionary.js.map +1 -1
- package/out/adapters/osm/adapter.d.ts +12 -1
- package/out/adapters/osm/adapter.d.ts.map +1 -1
- package/out/adapters/osm/adapter.js +30 -13
- package/out/adapters/osm/adapter.js.map +1 -1
- package/out/adapters.d.ts.map +1 -1
- package/out/adapters.js +14 -0
- package/out/adapters.js.map +1 -1
- package/out/az/adapters/opendata/adapter.d.ts +88 -0
- package/out/az/adapters/opendata/adapter.d.ts.map +1 -0
- package/out/az/adapters/opendata/adapter.js +282 -0
- package/out/az/adapters/opendata/adapter.js.map +1 -0
- package/out/bs/adapters/gbpa/adapter.d.ts +64 -0
- package/out/bs/adapters/gbpa/adapter.d.ts.map +1 -0
- package/out/bs/adapters/gbpa/adapter.js +187 -0
- package/out/bs/adapters/gbpa/adapter.js.map +1 -0
- package/out/build/types.d.ts +15 -0
- package/out/build/types.d.ts.map +1 -1
- package/out/build/types.js.map +1 -1
- package/out/build.d.ts.map +1 -1
- package/out/build.js +17 -0
- package/out/build.js.map +1 -1
- package/out/ee/adapters/ads/adapter.d.ts +6 -0
- package/out/ee/adapters/ads/adapter.d.ts.map +1 -1
- package/out/ee/adapters/ads/adapter.js +16 -0
- package/out/ee/adapters/ads/adapter.js.map +1 -1
- package/out/fo/adapters/adressur/adapter.d.ts +63 -0
- package/out/fo/adapters/adressur/adapter.d.ts.map +1 -0
- package/out/fo/adapters/adressur/adapter.js +177 -0
- package/out/fo/adapters/adressur/adapter.js.map +1 -0
- package/out/gb/adapters/os-open/adapter.d.ts +8 -0
- package/out/gb/adapters/os-open/adapter.d.ts.map +1 -1
- package/out/gb/adapters/os-open/adapter.js +11 -0
- package/out/gb/adapters/os-open/adapter.js.map +1 -1
- package/out/gb/county.d.ts +30 -0
- package/out/gb/county.d.ts.map +1 -0
- package/out/gb/county.js +51 -0
- package/out/gb/county.js.map +1 -0
- package/out/gb/os-open/open/names.d.ts +17 -0
- package/out/gb/os-open/open/names.d.ts.map +1 -1
- package/out/gb/os-open/open/names.js +19 -0
- package/out/gb/os-open/open/names.js.map +1 -1
- package/out/gu/adapters/bsp/adapter.d.ts +83 -0
- package/out/gu/adapters/bsp/adapter.d.ts.map +1 -0
- package/out/gu/adapters/bsp/adapter.js +346 -0
- package/out/gu/adapters/bsp/adapter.js.map +1 -0
- package/out/im/adapters/land-registry/adapter.d.ts +68 -0
- package/out/im/adapters/land-registry/adapter.d.ts.map +1 -0
- package/out/im/adapters/land-registry/adapter.js +261 -0
- package/out/im/adapters/land-registry/adapter.js.map +1 -0
- package/out/international/recipes/locale.d.ts +24 -4
- package/out/international/recipes/locale.d.ts.map +1 -1
- package/out/international/recipes/locale.js +107 -15
- package/out/international/recipes/locale.js.map +1 -1
- package/out/li/adapters/llv/adapter.d.ts +69 -0
- package/out/li/adapters/llv/adapter.d.ts.map +1 -0
- package/out/li/adapters/llv/adapter.js +181 -0
- package/out/li/adapters/llv/adapter.js.map +1 -0
- package/out/recipes/bare/postcode.d.ts.map +1 -1
- package/out/recipes/bare/postcode.js +9 -30
- package/out/recipes/bare/postcode.js.map +1 -1
- package/out/recipes/country-balanced.d.ts.map +1 -1
- package/out/recipes/country-balanced.js +82 -73
- package/out/recipes/country-balanced.js.map +1 -1
- package/out/recipes/intersection.d.ts +3 -2
- package/out/recipes/intersection.d.ts.map +1 -1
- package/out/recipes/intersection.js +20 -26
- package/out/recipes/intersection.js.map +1 -1
- package/out/recipes/po/box/cedex/recipe.d.ts.map +1 -1
- package/out/recipes/po/box/cedex/recipe.js +5 -4
- package/out/recipes/po/box/cedex/recipe.js.map +1 -1
- package/out/recipes/po/box/cedex/sources.d.ts +2 -45
- package/out/recipes/po/box/cedex/sources.d.ts.map +1 -1
- package/out/recipes/po/box/cedex/sources.js +0 -20
- package/out/recipes/po/box/cedex/sources.js.map +1 -1
- package/out/recipes/scaffold.d.ts +15 -2
- package/out/recipes/scaffold.d.ts.map +1 -1
- package/out/recipes/scaffold.js +21 -1
- package/out/recipes/scaffold.js.map +1 -1
- package/out/recipes/sources.d.ts.map +1 -1
- package/out/recipes/sources.js +112 -1
- package/out/recipes/sources.js.map +1 -1
- package/out/recipes/street/affix.d.ts.map +1 -1
- package/out/recipes/street/affix.js +8 -20
- package/out/recipes/street/affix.js.map +1 -1
- package/out/recipes/sub/venue/context.d.ts +14 -3
- package/out/recipes/sub/venue/context.d.ts.map +1 -1
- package/out/recipes/sub/venue/context.js +29 -9
- package/out/recipes/sub/venue/context.js.map +1 -1
- package/out/recipes/sub/venue/sources.d.ts +41 -8
- package/out/recipes/sub/venue/sources.d.ts.map +1 -1
- package/out/recipes/sub/venue/sources.js +26 -7
- package/out/recipes/sub/venue/sources.js.map +1 -1
- package/out/recipes/sub/venue.d.ts.map +1 -1
- package/out/recipes/sub/venue.js +35 -14
- package/out/recipes/sub/venue.js.map +1 -1
- package/out/recipes/unit.d.ts +4 -0
- package/out/recipes/unit.d.ts.map +1 -1
- package/out/recipes/unit.js +7 -6
- package/out/recipes/unit.js.map +1 -1
- package/out/registers.d.ts +33 -0
- package/out/registers.d.ts.map +1 -1
- package/out/registers.js +33 -0
- package/out/registers.js.map +1 -1
- package/out/source-register/corpus-inputs.d.ts +240 -0
- package/out/source-register/corpus-inputs.d.ts.map +1 -0
- package/out/source-register/corpus-inputs.js +275 -0
- package/out/source-register/corpus-inputs.js.map +1 -0
- package/out/source-register/effective-manifest.d.ts +2 -0
- package/out/source-register/effective-manifest.d.ts.map +1 -1
- package/out/source-register/effective-manifest.js +33 -4
- package/out/source-register/effective-manifest.js.map +1 -1
- package/out/source-register/types.d.ts +21 -1
- package/out/source-register/types.d.ts.map +1 -1
- package/out/source-register/types.js +20 -0
- package/out/source-register/types.js.map +1 -1
- package/out/south-asia/recipes/register.js +1 -1
- package/out/south-asia/recipes/register.js.map +1 -1
- package/out/tools/overlay/manifest.d.ts +7 -0
- package/out/tools/overlay/manifest.d.ts.map +1 -1
- package/out/tools/overlay/manifest.js +72 -1
- package/out/tools/overlay/manifest.js.map +1 -1
- package/out/tools/source-register/build.d.ts +9 -0
- package/out/tools/source-register/build.d.ts.map +1 -1
- package/out/tools/source-register/build.js +25 -3
- package/out/tools/source-register/build.js.map +1 -1
- package/out/tools/variety-sample.d.ts +196 -0
- package/out/tools/variety-sample.d.ts.map +1 -0
- package/out/tools/variety-sample.js +417 -0
- package/out/tools/variety-sample.js.map +1 -0
- package/out/us/adapters/usgov/nad/adapter.d.ts +80 -0
- package/out/us/adapters/usgov/nad/adapter.d.ts.map +1 -1
- package/out/us/adapters/usgov/nad/adapter.js +27 -8
- package/out/us/adapters/usgov/nad/adapter.js.map +1 -1
- package/out/us/recipes/skeleton-sources.d.ts +92 -0
- package/out/us/recipes/skeleton-sources.d.ts.map +1 -0
- package/out/us/recipes/skeleton-sources.js +121 -0
- package/out/us/recipes/skeleton-sources.js.map +1 -0
- package/out/us/tools/nad-skeletons.d.ts +120 -0
- package/out/us/tools/nad-skeletons.d.ts.map +1 -0
- package/out/us/tools/nad-skeletons.js +262 -0
- package/out/us/tools/nad-skeletons.js.map +1 -0
- package/out/uy/adapters/ide/adapter.d.ts +64 -0
- package/out/uy/adapters/ide/adapter.d.ts.map +1 -0
- package/out/uy/adapters/ide/adapter.js +206 -0
- package/out/uy/adapters/ide/adapter.js.map +1 -0
- package/out/ve/recipes/reviewed-postcode-tail.d.ts +6 -2
- package/out/ve/recipes/reviewed-postcode-tail.d.ts.map +1 -1
- package/out/ve/recipes/reviewed-postcode-tail.js +16 -5
- package/out/ve/recipes/reviewed-postcode-tail.js.map +1 -1
- package/package.json +14 -14
- package/lib/recipes/unit/sources.ts +0 -44
- package/lib/tools/fetch/ppd.ts +0 -121
- package/out/recipes/unit/sources.d.ts +0 -28
- package/out/recipes/unit/sources.d.ts.map +0 -1
- package/out/recipes/unit/sources.js +0 -30
- package/out/recipes/unit/sources.js.map +0 -1
- package/out/tools/fetch/ppd.d.ts +0 -15
- package/out/tools/fetch/ppd.d.ts.map +0 -1
- package/out/tools/fetch/ppd.js +0 -86
- package/out/tools/fetch/ppd.js.map +0 -1
package/lib/recipes/sub/venue.ts
CHANGED
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
type IdentifierModel,
|
|
26
26
|
type LegPools,
|
|
27
27
|
mergeNamePools,
|
|
28
|
+
NameSource,
|
|
28
29
|
type PoolQuery,
|
|
29
30
|
type PromotedSurface,
|
|
30
31
|
promotedSurfacesFor,
|
|
@@ -404,7 +405,7 @@ export interface SubVenueLegStats {
|
|
|
404
405
|
|
|
405
406
|
const LICENSE =
|
|
406
407
|
"Synthetic — OpenStreetMap venue + sub-venue names (ODbL, © OpenStreetMap contributors) and Overture Places names " +
|
|
407
|
-
"(CDLA-Permissive-2.0) over OpenAddresses /
|
|
408
|
+
"(CDLA-Permissive-2.0) over OpenAddresses / BAN / US situs / OS OpenData (OGL-UK-3.0) address skeletons"
|
|
408
409
|
|
|
409
410
|
const CORPUS_VERSION = "0.16.0"
|
|
410
411
|
|
|
@@ -424,10 +425,23 @@ interface EmitContext {
|
|
|
424
425
|
counters: { emitted: number; skipped: number; contaminated: number }
|
|
425
426
|
}
|
|
426
427
|
|
|
428
|
+
/**
|
|
429
|
+
* The distinct sources of a row's pooled names, sorted, or an empty list for a row that carries none.
|
|
430
|
+
*/
|
|
431
|
+
function rowNameSources(...sources: Array<NameSource | null>): NameSource[] {
|
|
432
|
+
return [...new Set(sources.filter((source) => source != null))].toSorted()
|
|
433
|
+
}
|
|
434
|
+
|
|
427
435
|
/**
|
|
428
436
|
* Renders and aligns one row.
|
|
429
437
|
* Writes the row and returns whether the write succeeded.
|
|
430
438
|
*
|
|
439
|
+
* The row's `name_sources` field lists the publications its pooled names were read from.
|
|
440
|
+
* The corpus schema has no such column.
|
|
441
|
+
*
|
|
442
|
+
* `jsonlToParquet` projects a row onto that schema, so the field reaches the
|
|
443
|
+
* recipe output and not a corpus parquet file.
|
|
444
|
+
*
|
|
431
445
|
* The function drops rows that contain an eval-board surface or fail alignment.
|
|
432
446
|
*/
|
|
433
447
|
function emitRow(
|
|
@@ -437,7 +451,8 @@ function emitRow(
|
|
|
437
451
|
groups: Group[],
|
|
438
452
|
register: Register,
|
|
439
453
|
synthMethod: string,
|
|
440
|
-
disambiguator: Record<string, string
|
|
454
|
+
disambiguator: Record<string, string>,
|
|
455
|
+
nameSources: NameSource[]
|
|
441
456
|
): boolean {
|
|
442
457
|
const { raw, components } = renderGroups(groups, register)
|
|
443
458
|
|
|
@@ -464,7 +479,9 @@ function emitRow(
|
|
|
464
479
|
return false
|
|
465
480
|
}
|
|
466
481
|
|
|
467
|
-
context.write(
|
|
482
|
+
context.write(
|
|
483
|
+
stringifyJSON({ ...aligned.row, synth_method: synthMethod, synth_base_id: null, name_sources: nameSources })
|
|
484
|
+
)
|
|
468
485
|
|
|
469
486
|
context.counters.emitted++
|
|
470
487
|
bump(stats.byRegister, register)
|
|
@@ -503,7 +520,7 @@ function emitPositives(
|
|
|
503
520
|
}
|
|
504
521
|
|
|
505
522
|
const tuple = sample(pools.context, random)
|
|
506
|
-
const venue = sample(pools.venues, random)
|
|
523
|
+
const { name: venue, source: venueSource } = sample(pools.venues, random)
|
|
507
524
|
|
|
508
525
|
// Alignment cannot place two spans when one contains the other, so the loop redraws.
|
|
509
526
|
const lowVenue = venue.toLowerCase()
|
|
@@ -523,11 +540,23 @@ function emitPositives(
|
|
|
523
540
|
// Real mail uses both "Terminal 5, Heathrow" and "Heathrow, Terminal 5".
|
|
524
541
|
const groups = r < SUBVENUE_FIRST_CUTOFF ? [subGroup, venueGroup, ...body] : [venueGroup, subGroup, ...body]
|
|
525
542
|
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
543
|
+
// An attested sub-venue string is an OpenStreetMap name, as `LegPools.attested` states.
|
|
544
|
+
const nameSources = rowNameSources(venueSource, form.form === "attested" ? NameSource.OpenStreetMap : null)
|
|
545
|
+
|
|
546
|
+
const ok = emitRow(
|
|
547
|
+
context,
|
|
548
|
+
leg,
|
|
549
|
+
stats,
|
|
550
|
+
groups,
|
|
551
|
+
register,
|
|
552
|
+
`sub-venue:${form.form}`,
|
|
553
|
+
{
|
|
554
|
+
leg: leg.locale,
|
|
555
|
+
form: form.form,
|
|
556
|
+
v: String(produced),
|
|
557
|
+
},
|
|
558
|
+
nameSources
|
|
559
|
+
)
|
|
531
560
|
|
|
532
561
|
if (!ok) continue
|
|
533
562
|
|
|
@@ -563,6 +592,8 @@ function emitNegatives(
|
|
|
563
592
|
const negativeClass = sample(available, random)
|
|
564
593
|
const register = sampleRegister(random)
|
|
565
594
|
let groups: Group[]
|
|
595
|
+
// A street negative carries no pooled name.
|
|
596
|
+
let nameSource: NameSource | null = null
|
|
566
597
|
|
|
567
598
|
if (negativeClass === NegativeClass.DesignatorStreet) {
|
|
568
599
|
groups = addressGroups(leg.country, pickTuple(streets.designator, random), true)
|
|
@@ -571,14 +602,19 @@ function emitNegatives(
|
|
|
571
602
|
} else if (negativeClass === NegativeClass.GateSuffixStreet) {
|
|
572
603
|
groups = addressGroups(leg.country, pickTuple(streets.gateSuffix, random), true)
|
|
573
604
|
} else {
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
605
|
+
let name: string
|
|
606
|
+
|
|
607
|
+
if (negativeClass === NegativeClass.UnpromotedShape) {
|
|
608
|
+
name = sample(pools.unpromotedShapes, random)
|
|
609
|
+
nameSource = NameSource.OpenStreetMap
|
|
610
|
+
} else {
|
|
611
|
+
const pool = negativeClass === NegativeClass.RejectedVenue ? pools.rejectedVenues : pools.longerNames
|
|
612
|
+
const drawn = sample(pool, random)
|
|
613
|
+
|
|
614
|
+
name = drawn.name
|
|
615
|
+
nameSource = drawn.source
|
|
616
|
+
}
|
|
617
|
+
|
|
582
618
|
const tuple = sample(pools.context, random)
|
|
583
619
|
|
|
584
620
|
groups = [
|
|
@@ -591,11 +627,20 @@ function emitNegatives(
|
|
|
591
627
|
// This happens when no layout covers the country.
|
|
592
628
|
if (!groups.length || groups.every((group) => group.every((piece) => piece.tag === "venue"))) continue
|
|
593
629
|
|
|
594
|
-
const ok = emitRow(
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
630
|
+
const ok = emitRow(
|
|
631
|
+
context,
|
|
632
|
+
leg,
|
|
633
|
+
stats,
|
|
634
|
+
groups,
|
|
635
|
+
register,
|
|
636
|
+
`sub-venue-negative:${negativeClass}`,
|
|
637
|
+
{
|
|
638
|
+
leg: leg.locale,
|
|
639
|
+
negative: negativeClass,
|
|
640
|
+
v: String(produced),
|
|
641
|
+
},
|
|
642
|
+
rowNameSources(nameSource)
|
|
643
|
+
)
|
|
599
644
|
|
|
600
645
|
if (!ok) continue
|
|
601
646
|
|
|
@@ -721,7 +766,7 @@ export const subVenueRecipe: CorpusRecipe = {
|
|
|
721
766
|
const negativeFraction = opts.negativeFraction ?? DEFAULT_NEGATIVE_FRACTION
|
|
722
767
|
const extractsDir = opts.extractsDir ?? dataRootPath("sub-venue", "extracts")
|
|
723
768
|
const venueNames = opts.venueNames ?? DEFAULT_VENUE_NAMES
|
|
724
|
-
const tuplesPath = opts.subVenueTuples ?? dataRootPath("corpus", "intermediate", "house-venue-tuples-
|
|
769
|
+
const tuplesPath = opts.subVenueTuples ?? dataRootPath("corpus", "intermediate", "house-venue-tuples-v6.jsonl")
|
|
725
770
|
const lexicon: SubVenueLexiconTable = await readSubVenueLexicon(opts.lexicon ?? defaultLexiconPath())
|
|
726
771
|
|
|
727
772
|
const context: EmitContext = {
|
package/lib/recipes/unit.ts
CHANGED
|
@@ -20,9 +20,14 @@ import { mulberry32 as makeMulberry32 } from "@mailwoman/core/utils"
|
|
|
20
20
|
import { stableSourceID } from "#adapters/source-id"
|
|
21
21
|
import { readOATuples, requireRegister, type CorpusRecipe } from "#recipes/scaffold"
|
|
22
22
|
import { defaultRecipeSource } from "#recipes/sources"
|
|
23
|
-
import { EVAL_SOURCE, TRAIN_SOURCES, type UnitSource } from "#recipes/unit/sources"
|
|
24
23
|
import { SurfaceOrigin } from "#types"
|
|
25
24
|
import type { CanonicalRow } from "#types"
|
|
25
|
+
import {
|
|
26
|
+
NAD_SKELETON_DIRECTORY,
|
|
27
|
+
US_SKELETON_EVAL_SOURCE,
|
|
28
|
+
US_SKELETON_TRAIN_SOURCES,
|
|
29
|
+
type USSkeletonSource,
|
|
30
|
+
} from "#us/recipes/skeleton-sources"
|
|
26
31
|
import { alignRow } from "#utils"
|
|
27
32
|
|
|
28
33
|
/**
|
|
@@ -75,11 +80,15 @@ export interface UnitTuple {
|
|
|
75
80
|
region: string
|
|
76
81
|
postcode: string
|
|
77
82
|
oaUnit: string
|
|
83
|
+
/**
|
|
84
|
+
* The register the skeleton came from, stamped on the row in place of the invocation's `--register`.
|
|
85
|
+
*/
|
|
86
|
+
register?: string
|
|
78
87
|
}
|
|
79
88
|
|
|
80
|
-
async function readTuples(source:
|
|
89
|
+
async function readTuples(source: USSkeletonSource): Promise<UnitTuple[]> {
|
|
81
90
|
return readOATuples(source, {
|
|
82
|
-
extra: (fields, row) => ({ ...fields, region: source.region, oaUnit: row.unit ?? "" }),
|
|
91
|
+
extra: (fields, row) => ({ ...fields, region: source.region, oaUnit: row.unit ?? "", register: source.register }),
|
|
83
92
|
})
|
|
84
93
|
}
|
|
85
94
|
|
|
@@ -232,7 +241,7 @@ export const unitRecipe: CorpusRecipe = {
|
|
|
232
241
|
const count = opts.count
|
|
233
242
|
const random = makeMulberry32(opts.seed)
|
|
234
243
|
const source = opts.sourceName ?? defaultRecipeSource("synth-unit")
|
|
235
|
-
const sources = opts.golden ? [
|
|
244
|
+
const sources = opts.golden ? [US_SKELETON_EVAL_SOURCE] : US_SKELETON_TRAIN_SOURCES
|
|
236
245
|
|
|
237
246
|
const pool: UnitTuple[] = []
|
|
238
247
|
|
|
@@ -247,7 +256,10 @@ export const unitRecipe: CorpusRecipe = {
|
|
|
247
256
|
}
|
|
248
257
|
|
|
249
258
|
if (!pool.length) {
|
|
250
|
-
throw new Error(
|
|
259
|
+
throw new Error(
|
|
260
|
+
`No US tuples found — are the cached OA zips present in ${dataRootPath("oa-cache")} and the NAD ` +
|
|
261
|
+
`skeletons in ${dataRootPath(NAD_SKELETON_DIRECTORY)}?`
|
|
262
|
+
)
|
|
251
263
|
}
|
|
252
264
|
|
|
253
265
|
let emitted = 0
|
|
@@ -287,7 +299,8 @@ export const unitRecipe: CorpusRecipe = {
|
|
|
287
299
|
source,
|
|
288
300
|
source_id: stableSourceID(source, components),
|
|
289
301
|
corpus_version: "0.4.0",
|
|
290
|
-
license:
|
|
302
|
+
license:
|
|
303
|
+
"OpenAddresses and National Address Database US (non-VT) skeletons + injected USPS Pub-28 C2 unit designators",
|
|
291
304
|
}
|
|
292
305
|
|
|
293
306
|
const aligned = alignRow(canonical)
|
|
@@ -303,7 +316,7 @@ export const unitRecipe: CorpusRecipe = {
|
|
|
303
316
|
...aligned.row,
|
|
304
317
|
recipe: "unit",
|
|
305
318
|
base_source_id: null,
|
|
306
|
-
register: requireRegister(opts, "unit"),
|
|
319
|
+
register: base.register ?? requireRegister(opts, "unit"),
|
|
307
320
|
surface: SurfaceOrigin.Composed,
|
|
308
321
|
})
|
|
309
322
|
)
|
package/lib/registers.ts
CHANGED
|
@@ -54,6 +54,39 @@ export const SourceRegister = {
|
|
|
54
54
|
* covers Svalbard beside the mainland.
|
|
55
55
|
*/
|
|
56
56
|
MatrikkelenAdresse: "no-matrikkelen-adresse",
|
|
57
|
+
/**
|
|
58
|
+
* `Direcciones Geográficas del Uruguay`, the national address points the Infraestructura
|
|
59
|
+
* de Datos Espaciales publishes as one CSV per department on catalogodatos.gub.uy.
|
|
60
|
+
*/
|
|
61
|
+
UruguayIDEDirecciones: "uy-ide-direcciones",
|
|
62
|
+
/**
|
|
63
|
+
* The `Verzeichnis der Gebäudeadressen`, Liechtenstein's official building-address index,
|
|
64
|
+
* which the Landesverwaltung publishes on service.geo.llv.li under its ABI/OGD license.
|
|
65
|
+
*/
|
|
66
|
+
LiechtensteinGebaeudeadressen: "li-llv-gebaeudeadressen",
|
|
67
|
+
/**
|
|
68
|
+
* `Adressur í Føroyum`, the Faroese national address register Umhvørvisstovan serves from gis.us.fo.
|
|
69
|
+
*/
|
|
70
|
+
FaroeAdressur: "fo-us-adressur",
|
|
71
|
+
/**
|
|
72
|
+
* The Isle of Man Land Registry's `Land transactions` file, one row per registered sale,
|
|
73
|
+
* published under the Isle of Man Open Government Licence.
|
|
74
|
+
*/
|
|
75
|
+
IsleOfManLandTransactions: "im-land-registry-transactions",
|
|
76
|
+
/**
|
|
77
|
+
* The Grand Bahama Port Authority's Freeport address points, published on GitHub under CC BY 4.0.
|
|
78
|
+
*/
|
|
79
|
+
GrandBahamaPortAuthorityAddresses: "bs-gbpa-addresses",
|
|
80
|
+
/**
|
|
81
|
+
* `Azərbaycanda obyektlər və məkanlar`, the objects-and-places points the Ministry
|
|
82
|
+
* of Ecology and Natural Resources publishes on opendata.az under CC BY.
|
|
83
|
+
*/
|
|
84
|
+
AzerbaijanObjectsAndPlaces: "az-opendata-obyektler",
|
|
85
|
+
/**
|
|
86
|
+
* The Government of Guam GISWEB Portal's `Address_Point_(Public_View)` layer,
|
|
87
|
+
* from the Bureau of Statistics & Plans GIS.
|
|
88
|
+
*/
|
|
89
|
+
GuamAddressPoints: "gu-bsp-address-points",
|
|
57
90
|
/**
|
|
58
91
|
* The INSPIRE Addresses theme of the Czech Office for Surveying, Mapping and Cadastre.
|
|
59
92
|
*
|