@mailwoman/core 4.16.2 → 5.0.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/chromium-i18n/ssl-address-download.ts +110 -0
- package/data/libpostal/resources-download.ts +121 -0
- package/out/api/APIClient.d.ts +2 -2
- package/out/api/APIClient.d.ts.map +1 -1
- package/out/api/APIClient.js +2 -2
- package/out/api/APIClient.js.map +1 -1
- package/out/api/responses.d.ts.map +1 -1
- package/out/api/responses.js.map +1 -1
- package/out/classification/Classification.d.ts +3 -4
- package/out/classification/Classification.d.ts.map +1 -1
- package/out/classification/Classification.js.map +1 -1
- package/out/classification/CompositeClassifier.d.ts +1 -1
- package/out/classification/CompositeClassifier.d.ts.map +1 -1
- package/out/classification/CompositeClassifier.js +1 -1
- package/out/classification/CompositeClassifier.js.map +1 -1
- package/out/classification/PhraseClassifier.d.ts.map +1 -1
- package/out/classification/PhraseClassifier.js.map +1 -1
- package/out/classification/SectionClassifier.d.ts.map +1 -1
- package/out/classification/SectionClassifier.js.map +1 -1
- package/out/classification/WordClassifier.d.ts.map +1 -1
- package/out/classification/WordClassifier.js.map +1 -1
- package/out/classification/scheme.d.ts.map +1 -1
- package/out/classification/scheme.js.map +1 -1
- package/out/coarse-placer/coarse-placer.d.ts +28 -34
- package/out/coarse-placer/coarse-placer.d.ts.map +1 -1
- package/out/coarse-placer/coarse-placer.js +17 -20
- package/out/coarse-placer/coarse-placer.js.map +1 -1
- package/out/coarse-placer/featurize.d.ts +17 -19
- package/out/coarse-placer/featurize.d.ts.map +1 -1
- package/out/coarse-placer/featurize.js +17 -19
- package/out/coarse-placer/featurize.js.map +1 -1
- package/out/collections.d.ts +1 -2
- package/out/collections.d.ts.map +1 -1
- package/out/collections.js +1 -2
- package/out/collections.js.map +1 -1
- package/out/data/chromium-i18n/ssl-address-download.d.ts +30 -0
- package/out/data/chromium-i18n/ssl-address-download.d.ts.map +1 -0
- package/out/data/chromium-i18n/ssl-address-download.js +98 -0
- package/out/data/chromium-i18n/ssl-address-download.js.map +1 -0
- package/out/data/libpostal/resources-download.d.ts +29 -0
- package/out/data/libpostal/resources-download.d.ts.map +1 -0
- package/out/data/libpostal/resources-download.js +107 -0
- package/out/data/libpostal/resources-download.js.map +1 -0
- package/out/db/schema.d.ts +2 -2
- package/out/decoder/arbitrate-tree.d.ts +3 -3
- package/out/decoder/arbitrate-tree.d.ts.map +1 -1
- package/out/decoder/arbitrate-tree.js +5 -5
- package/out/decoder/arbitrate-tree.js.map +1 -1
- package/out/decoder/build-tree.d.ts +12 -14
- package/out/decoder/build-tree.d.ts.map +1 -1
- package/out/decoder/build-tree.js +4 -5
- package/out/decoder/build-tree.js.map +1 -1
- package/out/decoder/calibration.d.ts +3 -4
- package/out/decoder/calibration.d.ts.map +1 -1
- package/out/decoder/calibration.js +3 -4
- package/out/decoder/calibration.js.map +1 -1
- package/out/decoder/containment.d.ts +5 -6
- package/out/decoder/containment.d.ts.map +1 -1
- package/out/decoder/containment.js +5 -6
- package/out/decoder/containment.js.map +1 -1
- package/out/decoder/index.d.ts +1 -0
- package/out/decoder/index.d.ts.map +1 -1
- package/out/decoder/index.js +1 -0
- package/out/decoder/index.js.map +1 -1
- package/out/decoder/proposals-to-tree.d.ts +9 -9
- package/out/decoder/proposals-to-tree.d.ts.map +1 -1
- package/out/decoder/proposals-to-tree.js +11 -11
- package/out/decoder/proposals-to-tree.js.map +1 -1
- package/out/decoder/resolve-proposal-overlaps.d.ts +3 -5
- package/out/decoder/resolve-proposal-overlaps.d.ts.map +1 -1
- package/out/decoder/resolve-proposal-overlaps.js +5 -6
- package/out/decoder/resolve-proposal-overlaps.js.map +1 -1
- package/out/decoder/serialize-json.d.ts +13 -1
- package/out/decoder/serialize-json.d.ts.map +1 -1
- package/out/decoder/serialize-json.js +6 -2
- package/out/decoder/serialize-json.js.map +1 -1
- package/out/decoder/serialize-tuples.d.ts +10 -1
- package/out/decoder/serialize-tuples.d.ts.map +1 -1
- package/out/decoder/serialize-tuples.js +13 -5
- package/out/decoder/serialize-tuples.js.map +1 -1
- package/out/decoder/serialize-xml.d.ts +15 -9
- package/out/decoder/serialize-xml.d.ts.map +1 -1
- package/out/decoder/serialize-xml.js +29 -12
- package/out/decoder/serialize-xml.js.map +1 -1
- package/out/decoder/types.d.ts +52 -61
- package/out/decoder/types.d.ts.map +1 -1
- package/out/decoder/types.js +2 -2
- package/out/decoder/unknown-spans.d.ts +46 -0
- package/out/decoder/unknown-spans.d.ts.map +1 -0
- package/out/decoder/unknown-spans.js +56 -0
- package/out/decoder/unknown-spans.js.map +1 -0
- package/out/decoder/validate-tree.d.ts.map +1 -1
- package/out/decoder/validate-tree.js +2 -3
- package/out/decoder/validate-tree.js.map +1 -1
- package/out/errors/schema.d.ts +1 -2
- package/out/errors/schema.d.ts.map +1 -1
- package/out/errors/schema.js +1 -2
- package/out/errors/schema.js.map +1 -1
- package/out/filters/RelationshipFilter.d.ts.map +1 -1
- package/out/filters/RelationshipFilter.js.map +1 -1
- package/out/formatter/index.d.ts.map +1 -1
- package/out/formatter/index.js.map +1 -1
- package/out/identifiers.d.ts.map +1 -1
- package/out/identifiers.js.map +1 -1
- package/out/kysley/client.d.ts +3 -4
- package/out/kysley/client.d.ts.map +1 -1
- package/out/kysley/client.js +3 -4
- package/out/kysley/client.js.map +1 -1
- package/out/kysley/dialect-config.d.ts +1 -1
- package/out/kysley/dialect-config.d.ts.map +1 -1
- package/out/kysley/dialect.d.ts +4 -4
- package/out/kysley/dialect.js +4 -4
- package/out/kysley/driver.d.ts.map +1 -1
- package/out/kysley/driver.js +1 -1
- package/out/kysley/driver.js.map +1 -1
- package/out/lifecycle/ServiceSymbol.d.ts +2 -4
- package/out/lifecycle/ServiceSymbol.d.ts.map +1 -1
- package/out/lifecycle/ServiceSymbol.js +2 -4
- package/out/lifecycle/ServiceSymbol.js.map +1 -1
- package/out/lifecycle/services.d.ts +7 -8
- package/out/lifecycle/services.d.ts.map +1 -1
- package/out/lifecycle/services.js +5 -4
- package/out/lifecycle/services.js.map +1 -1
- package/out/locale/locale.d.ts +5 -6
- package/out/locale/locale.d.ts.map +1 -1
- package/out/locale/registry.d.ts.map +1 -1
- package/out/locale/registry.js.map +1 -1
- package/out/logging/index.d.ts +1 -0
- package/out/logging/index.d.ts.map +1 -1
- package/out/logging/index.js +1 -0
- package/out/logging/index.js.map +1 -1
- package/out/logging/shared.d.ts +2 -2
- package/out/logging/shared.js +2 -2
- package/out/logging/utils.d.ts +30 -0
- package/out/logging/utils.d.ts.map +1 -0
- package/out/logging/utils.js +30 -0
- package/out/logging/utils.js.map +1 -0
- package/out/objects.d.ts +3 -4
- package/out/objects.d.ts.map +1 -1
- package/out/objects.js +1 -2
- package/out/objects.js.map +1 -1
- package/out/parser/AddressParser.d.ts +12 -16
- package/out/parser/AddressParser.d.ts.map +1 -1
- package/out/parser/AddressParser.js.map +1 -1
- package/out/parser/proposal-pipeline.d.ts +12 -12
- package/out/parser/proposal-pipeline.d.ts.map +1 -1
- package/out/parser/proposal-pipeline.js +12 -12
- package/out/parser/proposal-pipeline.js.map +1 -1
- package/out/parser/solution-to-proposals.d.ts +4 -4
- package/out/parser/solution-to-proposals.d.ts.map +1 -1
- package/out/parser/solution-to-proposals.js +5 -5
- package/out/parser/solution-to-proposals.js.map +1 -1
- package/out/pipeline/index.d.ts +1 -1
- package/out/pipeline/reconcile-lookups.d.ts +4 -4
- package/out/pipeline/reconcile-lookups.d.ts.map +1 -1
- package/out/pipeline/reconcile-lookups.js +4 -4
- package/out/pipeline/reconcile-lookups.js.map +1 -1
- package/out/pipeline/reconcile.d.ts +21 -23
- package/out/pipeline/reconcile.d.ts.map +1 -1
- package/out/pipeline/reconcile.js +49 -51
- package/out/pipeline/reconcile.js.map +1 -1
- package/out/pipeline/runtime-pipeline.d.ts +14 -16
- package/out/pipeline/runtime-pipeline.d.ts.map +1 -1
- package/out/pipeline/runtime-pipeline.js +33 -37
- package/out/pipeline/runtime-pipeline.js.map +1 -1
- package/out/pipeline/span-logit-aggregation.d.ts +5 -6
- package/out/pipeline/span-logit-aggregation.d.ts.map +1 -1
- package/out/pipeline/span-logit-aggregation.js +7 -8
- package/out/pipeline/span-logit-aggregation.js.map +1 -1
- package/out/pipeline/span-proposer.d.ts +18 -22
- package/out/pipeline/span-proposer.d.ts.map +1 -1
- package/out/pipeline/span-proposer.js +21 -22
- package/out/pipeline/span-proposer.js.map +1 -1
- package/out/pipeline/types.d.ts +77 -86
- package/out/pipeline/types.d.ts.map +1 -1
- package/out/policy/defaults.d.ts +5 -6
- package/out/policy/defaults.d.ts.map +1 -1
- package/out/policy/defaults.js +5 -6
- package/out/policy/defaults.js.map +1 -1
- package/out/policy/from-config.d.ts +8 -9
- package/out/policy/from-config.d.ts.map +1 -1
- package/out/policy/from-config.js +8 -9
- package/out/policy/from-config.js.map +1 -1
- package/out/policy/input-shape-router.d.ts +15 -19
- package/out/policy/input-shape-router.d.ts.map +1 -1
- package/out/policy/input-shape-router.js +11 -14
- package/out/policy/input-shape-router.js.map +1 -1
- package/out/policy/policy.d.ts +10 -13
- package/out/policy/policy.d.ts.map +1 -1
- package/out/policy/registry.d.ts +4 -5
- package/out/policy/registry.d.ts.map +1 -1
- package/out/policy/registry.js +6 -7
- package/out/policy/registry.js.map +1 -1
- package/out/resolver/index.d.ts +1 -1
- package/out/resolver/index.js +1 -1
- package/out/resolver/types.d.ts +212 -216
- package/out/resolver/types.d.ts.map +1 -1
- package/out/resolver/types.js +32 -39
- package/out/resolver/types.js.map +1 -1
- package/out/resources/LocaleIndex.d.ts +1 -2
- package/out/resources/LocaleIndex.d.ts.map +1 -1
- package/out/resources/LocaleIndex.js +1 -2
- package/out/resources/LocaleIndex.js.map +1 -1
- package/out/resources/ResourceMapCache.d.ts.map +1 -1
- package/out/resources/ResourceMapCache.js.map +1 -1
- package/out/resources/collections.d.ts +1 -2
- package/out/resources/collections.d.ts.map +1 -1
- package/out/resources/collections.js +1 -2
- package/out/resources/collections.js.map +1 -1
- package/out/resources/fs.d.ts.map +1 -1
- package/out/resources/fs.js.map +1 -1
- package/out/resources/git.d.ts.map +1 -1
- package/out/resources/git.js.map +1 -1
- package/out/resources/libaddressinput.d.ts +2 -2
- package/out/resources/libaddressinput.js +2 -2
- package/out/resources/libpostal.d.ts +4 -5
- package/out/resources/libpostal.d.ts.map +1 -1
- package/out/resources/libpostal.js +6 -7
- package/out/resources/libpostal.js.map +1 -1
- package/out/resources/set.d.ts +1 -2
- package/out/resources/set.d.ts.map +1 -1
- package/out/resources/set.js +1 -2
- package/out/resources/set.js.map +1 -1
- package/out/resources/whosonfirst/DataSourceCache.d.ts.map +1 -1
- package/out/resources/whosonfirst/DataSourceCache.js.map +1 -1
- package/out/resources/whosonfirst/PlacetypeDataSource.d.ts +1 -1
- package/out/resources/whosonfirst/PlacetypeDataSource.d.ts.map +1 -1
- package/out/resources/whosonfirst/PlacetypeDataSource.js +1 -1
- package/out/resources/whosonfirst/PlacetypeDataSource.js.map +1 -1
- package/out/resources/whosonfirst/loader.d.ts +1 -2
- package/out/resources/whosonfirst/loader.d.ts.map +1 -1
- package/out/resources/whosonfirst/loader.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/Placetype.d.ts +6 -9
- package/out/resources/whosonfirst/placetypes/Placetype.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/Placetype.js +7 -10
- package/out/resources/whosonfirst/placetypes/Placetype.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/admin.d.ts +1 -2
- package/out/resources/whosonfirst/placetypes/admin.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/admin.js +1 -2
- package/out/resources/whosonfirst/placetypes/admin.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/graph.d.ts +10 -10
- package/out/resources/whosonfirst/placetypes/graph.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/graph.js +0 -0
- package/out/resources/whosonfirst/placetypes/graph.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/mermaid.d.ts +16 -19
- package/out/resources/whosonfirst/placetypes/mermaid.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/mermaid.js +15 -16
- package/out/resources/whosonfirst/placetypes/mermaid.js.map +1 -1
- package/out/resources/whosonfirst/placetypes/tree.d.ts +6 -7
- package/out/resources/whosonfirst/placetypes/tree.d.ts.map +1 -1
- package/out/resources/whosonfirst/placetypes/tree.js +3 -4
- package/out/resources/whosonfirst/placetypes/tree.js.map +1 -1
- package/out/routing/index.d.ts +2 -3
- package/out/routing/index.d.ts.map +1 -1
- package/out/routing/index.js +1 -1
- package/out/routing/index.js.map +1 -1
- package/out/solver/HashMapSolver.d.ts.map +1 -1
- package/out/solver/HashMapSolver.js.map +1 -1
- package/out/solver/Solution.d.ts +2 -2
- package/out/solver/Solution.d.ts.map +1 -1
- package/out/solver/Solution.js +2 -2
- package/out/solver/Solution.js.map +1 -1
- package/out/solver/mask.d.ts.map +1 -1
- package/out/solver/mask.js.map +1 -1
- package/out/solvers/LeadingAreaDeclassifier.d.ts.map +1 -1
- package/out/solvers/LeadingAreaDeclassifier.js.map +1 -1
- package/out/solvers/MultiStreetSolver.d.ts +10 -15
- package/out/solvers/MultiStreetSolver.d.ts.map +1 -1
- package/out/solvers/MultiStreetSolver.js +10 -15
- package/out/solvers/MultiStreetSolver.js.map +1 -1
- package/out/solvers/PostcodePositionPenalty.d.ts +2 -2
- package/out/solvers/PostcodePositionPenalty.d.ts.map +1 -1
- package/out/solvers/PostcodePositionPenalty.js +2 -2
- package/out/solvers/PostcodePositionPenalty.js.map +1 -1
- package/out/tokenization/Span.d.ts +1 -3
- package/out/tokenization/Span.d.ts.map +1 -1
- package/out/tokenization/Span.js +1 -3
- package/out/tokenization/Span.js.map +1 -1
- package/out/tokenization/context.d.ts +1 -2
- package/out/tokenization/context.d.ts.map +1 -1
- package/out/tokenization/context.js +1 -2
- package/out/tokenization/context.js.map +1 -1
- package/out/tokenization/normalizer.js +2 -2
- package/out/tokenization/permutate.d.ts +2 -3
- package/out/tokenization/permutate.d.ts.map +1 -1
- package/out/tokenization/permutate.js +4 -5
- package/out/tokenization/permutate.js.map +1 -1
- package/out/types/classifier.d.ts +21 -23
- package/out/types/classifier.d.ts.map +1 -1
- package/out/types/component.d.ts +6 -7
- package/out/types/component.d.ts.map +1 -1
- package/out/types/component.js +5 -6
- package/out/types/component.js.map +1 -1
- package/out/types/mapping.d.ts +8 -8
- package/out/types/mapping.d.ts.map +1 -1
- package/out/types/mapping.js +13 -13
- package/out/types/mapping.js.map +1 -1
- package/out/utils/data-root.d.ts +5 -5
- package/out/utils/data-root.js +7 -7
- package/out/utils/repo.d.ts +3 -3
- package/out/utils/repo.d.ts.map +1 -1
- package/out/utils/repo.js +16 -19
- package/out/utils/repo.js.map +1 -1
- package/out/vitest.config.d.ts.map +1 -1
- package/out/vitest.config.js.map +1 -1
- package/package.json +18 -18
- package/data/chromium-i18n/ssl-address-download.sh +0 -15
- package/data/libpostal/resources-download.sh +0 -44
- package/out/logging/tables.d.ts +0 -7
- package/out/logging/tables.d.ts.map +0 -1
- package/out/logging/tables.js +0 -75
- package/out/logging/tables.js.map +0 -1
- package/out/sets.d.ts +0 -2
- package/out/sets.d.ts.map +0 -1
- package/out/sets.js +0 -2
- package/out/sets.js.map +0 -1
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*/
|
|
6
|
+
import type { PerformanceMeasure } from "node:perf_hooks";
|
|
6
7
|
import { Alpha2LanguageCode } from "@mailwoman/core";
|
|
7
8
|
import type { Classifier, ClassifierConstructor } from "@mailwoman/core/classification";
|
|
8
9
|
import type { PolicyRegistry } from "@mailwoman/core/policy";
|
|
9
10
|
import { type FilterRelation, type SerializedSolution, Solution, type Solver, type SolverConstructor } from "@mailwoman/core/solver";
|
|
10
11
|
import { TokenContext } from "@mailwoman/core/tokenization";
|
|
11
12
|
import type { ClassificationProposal, ProposalClassifier } from "@mailwoman/core/types";
|
|
12
|
-
import type { PerformanceMeasure } from "node:perf_hooks";
|
|
13
13
|
import { type WritebackResult } from "./proposal-pipeline.js";
|
|
14
14
|
export interface AddressParserOptions {
|
|
15
15
|
classifiers?: Iterable<Classifier | ClassifierConstructor>;
|
|
@@ -18,27 +18,24 @@ export interface AddressParserOptions {
|
|
|
18
18
|
solutionLimit?: number;
|
|
19
19
|
mustNotFollow?: FilterRelation[];
|
|
20
20
|
/**
|
|
21
|
-
* Proposal-based classifiers (rule classifiers via `wrapLegacyClassifier`, the neural classifier
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* `
|
|
25
|
-
* setups stay byte-compatible.
|
|
21
|
+
* Proposal-based classifiers (rule classifiers via `wrapLegacyClassifier`, the neural classifier via
|
|
22
|
+
* `createNeuralProposalClassifier`, or any custom impl). When provided, they run AFTER the legacy `classifiers`
|
|
23
|
+
* mutation pass; surviving proposals are written back to the same `TokenContext` for the solver. The legacy
|
|
24
|
+
* `classifiers` array still runs unchanged so existing setups stay byte-compatible.
|
|
26
25
|
*/
|
|
27
26
|
proposalClassifiers?: Iterable<ProposalClassifier>;
|
|
28
27
|
/**
|
|
29
|
-
* Policy registry consulted to filter the merged proposal stream before writeback. When absent,
|
|
30
|
-
*
|
|
31
|
-
* overrides set at startup.
|
|
28
|
+
* Policy registry consulted to filter the merged proposal stream before writeback. When absent, every proposal
|
|
29
|
+
* survives. Typically `InMemoryPolicyRegistry.withDefaults()` plus per-component overrides set at startup.
|
|
32
30
|
*/
|
|
33
31
|
policy?: PolicyRegistry;
|
|
34
32
|
}
|
|
35
33
|
export interface ParseOptions {
|
|
36
34
|
verbose?: boolean;
|
|
37
35
|
/**
|
|
38
|
-
* BCP-47 locale tag (e.g. `"en-US"`, `"fr-FR"`). When provided, downstream locale-aware pipelines
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* tagging their requests now.
|
|
36
|
+
* BCP-47 locale tag (e.g. `"en-US"`, `"fr-FR"`). When provided, downstream locale-aware pipelines (Phase 1+) narrow
|
|
37
|
+
* classification to the registered `LocaleProfile`. Accepted but ignored by the legacy rule-only pipeline in Phase 0;
|
|
38
|
+
* the field exists so the CLI and library callers can begin tagging their requests now.
|
|
42
39
|
*/
|
|
43
40
|
locale?: string;
|
|
44
41
|
}
|
|
@@ -51,9 +48,8 @@ export interface VerboseParseResult {
|
|
|
51
48
|
solver: PerformanceMeasure;
|
|
52
49
|
};
|
|
53
50
|
/**
|
|
54
|
-
* Present when proposal classifiers ran. `proposals` is the policy-filtered list; `writeback` is
|
|
55
|
-
*
|
|
56
|
-
* `proposalClassifiers` were configured.
|
|
51
|
+
* Present when proposal classifiers ran. `proposals` is the policy-filtered list; `writeback` is a small summary of
|
|
52
|
+
* how many proposals reached the context's span graph. Omitted when no `proposalClassifiers` were configured.
|
|
57
53
|
*/
|
|
58
54
|
proposals?: {
|
|
59
55
|
filtered: ClassificationProposal[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressParser.d.ts","sourceRoot":"","sources":["../../parser/AddressParser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AACvF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EACN,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,QAAQ,EACR,KAAK,MAAM,EACX,KAAK,iBAAiB,EACtB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"AddressParser.d.ts","sourceRoot":"","sources":["../../parser/AddressParser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE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js","sourceRoot":"","sources":["../../parser/AddressParser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"AddressParser.js","sourceRoot":"","sources":["../../parser/AddressParser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAGpD,OAAO,EAGN,QAAQ,GAGR,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAG3D,OAAO,EAAE,mBAAmB,EAAwB,MAAM,wBAAwB,CAAA;AAuDlF;;GAEG;AACH,MAAM,OAAO,aAAa;IACf,WAAW,CAAc;IACzB,OAAO,CAAU;IACjB,mBAAmB,CAAsB;IACzC,MAAM,CAAiB;IAEvB,aAAa,CAAQ;IAE/B,YAAY,GAAG,KAAK,CAAA;IAEpB,YAAY,EACX,SAAS,EACT,WAAW,GAAG,EAAE,EAChB,OAAO,GAAG,EAAE,EACZ,mBAAmB,GAAG,EAAE,EACxB,MAAM,EACN,aAAa,GAAG,EAAE,MACO,EAAE;QAC3B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,iBAAiB,EAAE,EAAE;YAChE,OAAO,OAAO,iBAAiB,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,iBAAiB,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAA;QAC1G,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,aAAa,EAAE,EAAE;YACpD,OAAO,OAAO,aAAa,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC,CAAC,aAAa,CAAA;QACjF,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAA;Q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ACtD,CAAC;IAED,mBAAmB,GAAG,IAAI,OAAO,EAAkC,CAAA;IAEnE;;OAEG;IACO,QAAQ,CAAC,OAAqB;QACvC,KAAK,MAAM,CAAC,CAAC,EAAE,UAAU,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE,CAAC;YAC1D,MAAM,cAAc,GAAG,UAAU,CAAC,WAAW,EAAE,IAAI,IAAI,sBAAsB,CAAC,GAAG,CAAC,EAAE,CAAA;YAEpF,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAA;YAE/B,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,CAAA;YAElC,MAAM,eAAe,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,EAAE;gBACvD,KAAK;gBACL,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE;gBACtB,MAAM,EAAE,cAAc;aACtB,CAAC,CAAA;YAEF,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,UAAU,EAAE,eAAe,CAAC,CAAA;QAC1D,CAAC;IACF,CAAC;IAED;;OAEG;IACI,uBAAuB,CAAC,UAAsB;QACpD,OAAO,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;IAChD,CAAC;IAED;;OAEG;IACI,aAAa,CAAC,OAAqB;QACzC,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACnC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;YAE3C,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QACtB,CAAC;QAED,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;QAE3C,OAAO,OAAO,CAAC,SAAS,CAAA;IACzB,CAAC;CACD"}
|
|
@@ -21,9 +21,9 @@ import { type ClassificationProposal, type ClassifierContext, type ProposalClass
|
|
|
21
21
|
/**
|
|
22
22
|
* Run every classifier against every section, concatenate the results.
|
|
23
23
|
*
|
|
24
|
-
* Classifiers that throw are isolated — their failure logs but does not block other classifiers'
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* Classifiers that throw are isolated — their failure logs but does not block other classifiers' proposals from being
|
|
25
|
+
* collected. (Per the `ProposalClassifier` contract, implementations are supposed to swallow errors, but
|
|
26
|
+
* defense-in-depth lives here.)
|
|
27
27
|
*/
|
|
28
28
|
export declare function collectProposals(sections: readonly Span[], classifiers: readonly ProposalClassifier[], context?: ClassifierContext): Promise<ClassificationProposal[]>;
|
|
29
29
|
/**
|
|
@@ -32,13 +32,13 @@ export declare function collectProposals(sections: readonly Span[], classifiers:
|
|
|
32
32
|
* Resolution order:
|
|
33
33
|
*
|
|
34
34
|
* 1. An explicit `policy` registry is authoritative (the operator's config wins entirely).
|
|
35
|
-
* 2. Otherwise, when an input-shape `routerPrior` is supplied (#478 increment 2), build a registry
|
|
36
|
-
*
|
|
35
|
+
* 2. Otherwise, when an input-shape `routerPrior` is supplied (#478 increment 2), build a registry whose default mode is
|
|
36
|
+
* the routed prior and apply that.
|
|
37
37
|
* 3. Otherwise return the input unchanged.
|
|
38
38
|
*
|
|
39
|
-
* Increment 2 ships with no production caller passing `routerPrior` (the production `runPipeline`
|
|
40
|
-
*
|
|
41
|
-
*
|
|
39
|
+
* Increment 2 ships with no production caller passing `routerPrior` (the production `runPipeline` does not yet feed
|
|
40
|
+
* live signals — that is increment 3), so this stays byte-stable by default. The seam is exercised by the
|
|
41
|
+
* router/proposal-pipeline tests.
|
|
42
42
|
*/
|
|
43
43
|
export declare function filterByPolicy(proposals: readonly ClassificationProposal[], policy: PolicyRegistry | undefined, locale: string | undefined, routerPrior?: InputShapeRoute): ClassificationProposal[];
|
|
44
44
|
/**
|
|
@@ -52,8 +52,8 @@ export declare function filterByPolicy(proposals: readonly ClassificationProposa
|
|
|
52
52
|
*/
|
|
53
53
|
export declare function findSpanByRange(context: TokenContext, start: number, end: number): Span | null;
|
|
54
54
|
/**
|
|
55
|
-
* Walk every span attached to a `TokenContext` — sections, words, phrases — in a single flat pass.
|
|
56
|
-
*
|
|
55
|
+
* Walk every span attached to a `TokenContext` — sections, words, phrases — in a single flat pass. Order isn't
|
|
56
|
+
* guaranteed.
|
|
57
57
|
*/
|
|
58
58
|
export declare function iterateContextSpans(context: TokenContext): Generator<Span>;
|
|
59
59
|
export interface WritebackResult {
|
|
@@ -62,8 +62,8 @@ export interface WritebackResult {
|
|
|
62
62
|
skippedNoSpan: number;
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
|
-
* Write each surviving proposal back to the context's span graph as a legacy `Classification` so
|
|
66
|
-
*
|
|
65
|
+
* Write each surviving proposal back to the context's span graph as a legacy `Classification` so the solver can read
|
|
66
|
+
* it. Returns a small summary useful for telemetry and tests.
|
|
67
67
|
*/
|
|
68
68
|
export declare function writeProposalsToContext(proposals: readonly ClassificationProposal[], context: TokenContext): WritebackResult;
|
|
69
69
|
/** Combined entrypoint: collect + filter + write. Returns the (post-filter) proposal list. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proposal-pipeline.d.ts","sourceRoot":"","sources":["../../parser/proposal-pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,EACN,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EAGtB,KAAK,kBAAkB,EACvB,MAAM,mBAAmB,CAAA;AAE1B;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACrC,QAAQ,EAAE,SAAS,IAAI,EAAE,EACzB,WAAW,EAAE,SAAS,kBAAkB,EAAE,EAC1C,OAAO,GAAE,iBAAsB,GAC7B,OAAO,CAAC,sBAAsB,EAAE,CAAC,
|
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,sBAAsB,EAAE,EAC5C,OAAO,EAAE,YAAY,GACnB,eAAe,CAuBjB;AAED,8FAA8F;AAC9F,wBAAsB,mBAAmB,CACxC,OAAO,EAAE,YAAY,EACrB,WAAW,EAAE,SAAS,kBAAkB,EAAE,EAC1C,OAAO,GAAE;IACR,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IACrC,yFAAyF;IACzF,WAAW,CAAC,EAAE,eAAe,CAAA;CACxB,GACJ,OAAO,CAAC;IAAE,SAAS,EAAE,sBAAsB,EAAE,CAAC;IAAC,SAAS,EAAE,eAAe,CAAA;CAAE,CAAC,CAM9E"}
|
|
@@ -19,9 +19,9 @@ import { componentTagToLegacyClassification, } from "../types/index.js";
|
|
|
19
19
|
/**
|
|
20
20
|
* Run every classifier against every section, concatenate the results.
|
|
21
21
|
*
|
|
22
|
-
* Classifiers that throw are isolated — their failure logs but does not block other classifiers'
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* Classifiers that throw are isolated — their failure logs but does not block other classifiers' proposals from being
|
|
23
|
+
* collected. (Per the `ProposalClassifier` contract, implementations are supposed to swallow errors, but
|
|
24
|
+
* defense-in-depth lives here.)
|
|
25
25
|
*/
|
|
26
26
|
export async function collectProposals(sections, classifiers, context = {}) {
|
|
27
27
|
const tasks = [];
|
|
@@ -42,13 +42,13 @@ export async function collectProposals(sections, classifiers, context = {}) {
|
|
|
42
42
|
* Resolution order:
|
|
43
43
|
*
|
|
44
44
|
* 1. An explicit `policy` registry is authoritative (the operator's config wins entirely).
|
|
45
|
-
* 2. Otherwise, when an input-shape `routerPrior` is supplied (#478 increment 2), build a registry
|
|
46
|
-
*
|
|
45
|
+
* 2. Otherwise, when an input-shape `routerPrior` is supplied (#478 increment 2), build a registry whose default mode is
|
|
46
|
+
* the routed prior and apply that.
|
|
47
47
|
* 3. Otherwise return the input unchanged.
|
|
48
48
|
*
|
|
49
|
-
* Increment 2 ships with no production caller passing `routerPrior` (the production `runPipeline`
|
|
50
|
-
*
|
|
51
|
-
*
|
|
49
|
+
* Increment 2 ships with no production caller passing `routerPrior` (the production `runPipeline` does not yet feed
|
|
50
|
+
* live signals — that is increment 3), so this stays byte-stable by default. The seam is exercised by the
|
|
51
|
+
* router/proposal-pipeline tests.
|
|
52
52
|
*/
|
|
53
53
|
export function filterByPolicy(proposals, policy, locale, routerPrior) {
|
|
54
54
|
const effective = policy ?? (routerPrior ? policyRegistryFromRoute(routerPrior) : undefined);
|
|
@@ -82,8 +82,8 @@ export function findSpanByRange(context, start, end) {
|
|
|
82
82
|
return best;
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
85
|
-
* Walk every span attached to a `TokenContext` — sections, words, phrases — in a single flat pass.
|
|
86
|
-
*
|
|
85
|
+
* Walk every span attached to a `TokenContext` — sections, words, phrases — in a single flat pass. Order isn't
|
|
86
|
+
* guaranteed.
|
|
87
87
|
*/
|
|
88
88
|
export function* iterateContextSpans(context) {
|
|
89
89
|
const visited = new Set();
|
|
@@ -105,8 +105,8 @@ export function* iterateContextSpans(context) {
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
108
|
-
* Write each surviving proposal back to the context's span graph as a legacy `Classification` so
|
|
109
|
-
*
|
|
108
|
+
* Write each surviving proposal back to the context's span graph as a legacy `Classification` so the solver can read
|
|
109
|
+
* it. Returns a small summary useful for telemetry and tests.
|
|
110
110
|
*/
|
|
111
111
|
export function writeProposalsToContext(proposals, context) {
|
|
112
112
|
let written = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proposal-pipeline.js","sourceRoot":"","sources":["../../parser/proposal-pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAIlE,OAAO,EAIN,kCAAkC,GAElC,MAAM,mBAAmB,CAAA;A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;AAED,8FAA8F;AAC9F,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACxC,OAAqB,EACrB,WAA0C,EAC1C,UAMI,EAAE;IAEN,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAAC,OAAO,CAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAA;IAClG,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;IACzF,MAAM,SAAS,GAAG,uBAAuB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAE5D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAA;AAC1C,CAAC"}
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
import type { SerializedSolution } from "../solver/index.js";
|
|
19
19
|
import { type ClassificationProposal } from "../types/index.js";
|
|
20
20
|
/**
|
|
21
|
-
* Project a solved v0 solution's matches into `rule`-sourced proposals. Matches whose legacy
|
|
22
|
-
*
|
|
21
|
+
* Project a solved v0 solution's matches into `rule`-sourced proposals. Matches whose legacy classification has no
|
|
22
|
+
* `ComponentTag` mapping (e.g. structural-only tags) are skipped.
|
|
23
23
|
*
|
|
24
24
|
* @param solution A `SerializedSolution` from `AddressParser.parse()` (typically the top solution).
|
|
25
|
-
* @param
|
|
25
|
+
* @param sourceID Stable id surfaced as `source_id` (default `"rule"`).
|
|
26
26
|
*/
|
|
27
|
-
export declare function solutionToProposals(solution: SerializedSolution,
|
|
27
|
+
export declare function solutionToProposals(solution: SerializedSolution, sourceID?: string): ClassificationProposal[];
|
|
28
28
|
//# sourceMappingURL=solution-to-proposals.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solution-to-proposals.d.ts","sourceRoot":"","sources":["../../parser/solution-to-proposals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAE5D,OAAO,EAAE,KAAK,sBAAsB,EAAsC,MAAM,mBAAmB,CAAA;AAEnG;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,QAAQ,SAAS,GAAG,sBAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"solution-to-proposals.d.ts","sourceRoot":"","sources":["../../parser/solution-to-proposals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAE5D,OAAO,EAAE,KAAK,sBAAsB,EAAsC,MAAM,mBAAmB,CAAA;AAEnG;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,QAAQ,SAAS,GAAG,sBAAsB,EAAE,CAoB7G"}
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { legacyClassificationToComponentTag } from "../types/index.js";
|
|
19
19
|
/**
|
|
20
|
-
* Project a solved v0 solution's matches into `rule`-sourced proposals. Matches whose legacy
|
|
21
|
-
*
|
|
20
|
+
* Project a solved v0 solution's matches into `rule`-sourced proposals. Matches whose legacy classification has no
|
|
21
|
+
* `ComponentTag` mapping (e.g. structural-only tags) are skipped.
|
|
22
22
|
*
|
|
23
23
|
* @param solution A `SerializedSolution` from `AddressParser.parse()` (typically the top solution).
|
|
24
|
-
* @param
|
|
24
|
+
* @param sourceID Stable id surfaced as `source_id` (default `"rule"`).
|
|
25
25
|
*/
|
|
26
|
-
export function solutionToProposals(solution,
|
|
26
|
+
export function solutionToProposals(solution, sourceID = "rule") {
|
|
27
27
|
const proposals = [];
|
|
28
28
|
for (const match of solution.matches) {
|
|
29
29
|
const component = legacyClassificationToComponentTag(match.classification);
|
|
@@ -35,7 +35,7 @@ export function solutionToProposals(solution, sourceId = "rule") {
|
|
|
35
35
|
component,
|
|
36
36
|
confidence: match.confidence,
|
|
37
37
|
source: "rule",
|
|
38
|
-
source_id:
|
|
38
|
+
source_id: sourceID,
|
|
39
39
|
penalty: 0,
|
|
40
40
|
});
|
|
41
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solution-to-proposals.js","sourceRoot":"","sources":["../../parser/solution-to-proposals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,EAA+B,kCAAkC,EAAE,MAAM,mBAAmB,CAAA;AAEnG;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAA4B,EAAE,QAAQ,GAAG,MAAM;IAClF,MAAM,SAAS,GAA6B,EAAE,CAAA;IAE9C,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;QACtC,MAAM,SAAS,GAAG,kCAAkC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"solution-to-proposals.js","sourceRoot":"","sources":["../../parser/solution-to-proposals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,EAA+B,kCAAkC,EAAE,MAAM,mBAAmB,CAAA;AAEnG;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAA4B,EAAE,QAAQ,GAAG,MAAM;IAClF,MAAM,SAAS,GAA6B,EAAE,CAAA;IAE9C,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;QACtC,MAAM,SAAS,GAAG,kCAAkC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;QAE1E,IAAI,CAAC,SAAS;YAAE,SAAQ;QAExB,MAAM,IAAI,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,EAAqB,CAAA;QACzF,SAAS,CAAC,IAAI,CAAC;YACd,IAAI;YACJ,SAAS;YACT,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,MAAM,EAAE,MAAM;YACd,SAAS,EAAE,QAAQ;YACnB,OAAO,EAAE,CAAC;SACV,CAAC,CAAA;IACH,CAAC;IAED,OAAO,SAAS,CAAA;AACjB,CAAC"}
|
package/out/pipeline/index.d.ts
CHANGED
|
@@ -12,5 +12,5 @@ export { aggregateSpanLogits } from "./span-logit-aggregation.js";
|
|
|
12
12
|
export type { SpanBounds, TokenPiece } from "./span-logit-aggregation.js";
|
|
13
13
|
export { EMPTY_SPAN_PROPOSER_LEXICON, proposeSpans } from "./span-proposer.js";
|
|
14
14
|
export type { ProposedSpan, ProposedSpanKind, SpanProposerLexicon } from "./span-proposer.js";
|
|
15
|
-
export type { AddressClassifier, ClassifierOpts,
|
|
15
|
+
export type { AddressClassifier, ClassifierOpts, FSTMatcherLike, LocaleHint, LocaleTag, NormalizedInputLite, PhraseGrouper, PhraseKind, PhraseProposal, PipelineOpts, PipelineResult, PipelineTiming, QueryKind, QueryKindResult, QueryShapeLite, RuntimePipelineStages, UserLocation, } from "./types.js";
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -23,11 +23,11 @@ export interface ReconcileLookups {
|
|
|
23
23
|
/**
|
|
24
24
|
* Build the reconciler's concordance lookups from one bounded pre-fetch pass over the backend.
|
|
25
25
|
*
|
|
26
|
-
* @param backend The gazetteer backend (Stage 6's `
|
|
27
|
-
*
|
|
26
|
+
* @param backend The gazetteer backend (Stage 6's `WOFSqlitePlaceLookup.asResolverBackend()` in production; any
|
|
27
|
+
* structural match in tests).
|
|
28
28
|
* @param raw The normalized input text — span bounds index into this.
|
|
29
|
-
* @param classifierTopK The aggregated per-span tag candidates (score-descending preferred; the
|
|
30
|
-
*
|
|
29
|
+
* @param classifierTopK The aggregated per-span tag candidates (score-descending preferred; the budget follows this
|
|
30
|
+
* order).
|
|
31
31
|
* @param opts.maxLookups Hard cap on `findPlace` calls (default 12).
|
|
32
32
|
* @param opts.candidatesPerPair Max places retained per (span, tag) pair (default 3).
|
|
33
33
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconcile-lookups.d.ts","sourceRoot":"","sources":["../../pipeline/reconcile-lookups.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAiB,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAItG,MAAM,WAAW,gBAAgB;IAChC,kBAAkB,EAAE,wBAAwB,CAAA;IAC5C,WAAW,EAAE,iBAAiB,CAAA;CAC9B;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,wBAAwB,CAC7C,OAAO,EAAE,eAAe,EACxB,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,aAAa,CAAC,mBAAmB,CAAC,EAClD,IAAI,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,GACjF,OAAO,CAAC,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"reconcile-lookups.d.ts","sourceRoot":"","sources":["../../pipeline/reconcile-lookups.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAiB,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAItG,MAAM,WAAW,gBAAgB;IAChC,kBAAkB,EAAE,wBAAwB,CAAA;IAC5C,WAAW,EAAE,iBAAiB,CAAA;CAC9B;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,wBAAwB,CAC7C,OAAO,EAAE,eAAe,EACxB,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,aAAa,CAAC,mBAAmB,CAAC,EAClD,IAAI,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,GACjF,OAAO,CAAC,gBAAgB,CAAC,CAgE3B"}
|
|
@@ -18,11 +18,11 @@ const RESOLVABLE_TAGS = new Set(["country", "region", "locality", "dependent_loc
|
|
|
18
18
|
/**
|
|
19
19
|
* Build the reconciler's concordance lookups from one bounded pre-fetch pass over the backend.
|
|
20
20
|
*
|
|
21
|
-
* @param backend The gazetteer backend (Stage 6's `
|
|
22
|
-
*
|
|
21
|
+
* @param backend The gazetteer backend (Stage 6's `WOFSqlitePlaceLookup.asResolverBackend()` in production; any
|
|
22
|
+
* structural match in tests).
|
|
23
23
|
* @param raw The normalized input text — span bounds index into this.
|
|
24
|
-
* @param classifierTopK The aggregated per-span tag candidates (score-descending preferred; the
|
|
25
|
-
*
|
|
24
|
+
* @param classifierTopK The aggregated per-span tag candidates (score-descending preferred; the budget follows this
|
|
25
|
+
* order).
|
|
26
26
|
* @param opts.maxLookups Hard cap on `findPlace` calls (default 12).
|
|
27
27
|
* @param opts.candidatesPerPair Max places retained per (span, tag) pair (default 3).
|
|
28
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconcile-lookups.js","sourceRoot":"","sources":["../../pipeline/reconcile-lookups.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,oBAAoB,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAA;AAO/G;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC7C,OAAwB,EACxB,GAAW,EACX,cAAkD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K,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;gBAC/C,sFAAsF;gBACtF,4EAA4E;gBAC5E,UAAU,CAAC,GAAG,CACb,KAAK,CAAC,EAAE,EACR,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAkB,CAAC,CACvG,CAAA;YACF,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO;QACN,kBAAkB,EAAE;YACnB,aAAa,CAAC,IAAI,EAAE,GAAG;gBACtB,OAAO,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAA;YACpD,CAAC;SACD;QACD,WAAW,EAAE;YACZ,SAAS,CAAC,KAAK;gBACd,OAAO,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;YACtC,CAAC;SACD;KACD,CAAA;AACF,CAAC"}
|
|
@@ -40,13 +40,13 @@ import type { AddressTree, ComponentTag } from "../decoder/types.js";
|
|
|
40
40
|
import type { ResolvedPlace } from "../resolver/types.js";
|
|
41
41
|
import type { PhraseProposal } from "./types.js";
|
|
42
42
|
/**
|
|
43
|
-
* One classifier interpretation for one input span. Pins the Thread C-s contract for the reconciler
|
|
44
|
-
*
|
|
45
|
-
*
|
|
43
|
+
* One classifier interpretation for one input span. Pins the Thread C-s contract for the reconciler — the real
|
|
44
|
+
* classifier emits this directly once that thread lands. Until then, tests hand-build a list of these to simulate top-k
|
|
45
|
+
* output.
|
|
46
46
|
*
|
|
47
|
-
* The classifier may emit multiple candidates for the same span (different tag hypotheses); the
|
|
48
|
-
*
|
|
49
|
-
* phrase
|
|
47
|
+
* The classifier may emit multiple candidates for the same span (different tag hypotheses); the reconciler treats those
|
|
48
|
+
* as the top-k tag axis. Candidates whose `span` does not exactly match a phrase proposal's span are ignored — the
|
|
49
|
+
* phrase grouper is the boundary-discovery authority.
|
|
50
50
|
*/
|
|
51
51
|
export interface ClassifierCandidate {
|
|
52
52
|
span: {
|
|
@@ -58,9 +58,9 @@ export interface ClassifierCandidate {
|
|
|
58
58
|
score: number;
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
-
* Resolver lookup for the (span, tag) axis. In production wraps a `ResolverBackend` (Stage 6); in
|
|
62
|
-
*
|
|
63
|
-
*
|
|
61
|
+
* Resolver lookup for the (span, tag) axis. In production wraps a `ResolverBackend` (Stage 6); in tests an in-memory
|
|
62
|
+
* table built per fixture. Returned candidates must already be sorted descending by score — the reconciler takes the
|
|
63
|
+
* top `kResolver` as-is.
|
|
64
64
|
*/
|
|
65
65
|
export interface ResolverCandidatesLookup {
|
|
66
66
|
candidatesFor(span: {
|
|
@@ -69,9 +69,8 @@ export interface ResolverCandidatesLookup {
|
|
|
69
69
|
}, tag: ComponentTag): ReadonlyArray<ResolvedPlace>;
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
|
-
* Parent-chain lookup for concordance scoring. WOF SQLite is the source of truth in production
|
|
73
|
-
*
|
|
74
|
-
* reconciler only checks membership).
|
|
72
|
+
* Parent-chain lookup for concordance scoring. WOF SQLite is the source of truth in production (Stage 6); tests pass a
|
|
73
|
+
* `Map`-backed mock. Returns the place's ancestors (order unimportant — the reconciler only checks membership).
|
|
75
74
|
*/
|
|
76
75
|
export interface ParentChainLookup {
|
|
77
76
|
parentsOf(place: ResolvedPlace): ReadonlyArray<ResolvedPlace>;
|
|
@@ -94,9 +93,8 @@ export interface ReconcileOpts {
|
|
|
94
93
|
/** Top-k resolver candidates retained per (span, tag) — default 5. */
|
|
95
94
|
kResolver?: number;
|
|
96
95
|
/**
|
|
97
|
-
* Concordance bonus multiplier. 1.0 weights chain-consistency equal to one classifier-score
|
|
98
|
-
*
|
|
99
|
-
* 1.0.
|
|
96
|
+
* Concordance bonus multiplier. 1.0 weights chain-consistency equal to one classifier-score factor; lower values
|
|
97
|
+
* trust the classifier more, higher values trust the gazetteer more. Default 1.0.
|
|
100
98
|
*/
|
|
101
99
|
concordanceWeight?: number;
|
|
102
100
|
/** Beam width during search — default 16. */
|
|
@@ -120,16 +118,16 @@ export interface ParseTree {
|
|
|
120
118
|
scoreBreakdown: ScoreBreakdown;
|
|
121
119
|
}
|
|
122
120
|
/**
|
|
123
|
-
* Joint-decode the best parse tree from Stage 2.7 phrase proposals, Stage 3 classifier top-k, and
|
|
124
|
-
*
|
|
121
|
+
* Joint-decode the best parse tree from Stage 2.7 phrase proposals, Stage 3 classifier top-k, and Stage 6 resolver
|
|
122
|
+
* candidates. See file header for the scoring formula.
|
|
125
123
|
*
|
|
126
|
-
* The result tree's roots are the winning `(span, tag, place)` triples in source order. Each node's
|
|
127
|
-
* `
|
|
128
|
-
*
|
|
124
|
+
* The result tree's roots are the winning `(span, tag, place)` triples in source order. Each node's `placeID`, `lat`,
|
|
125
|
+
* `lon` come from the chosen resolver candidate; `confidence` reflects the per- factor score for that slot. `runnersUp`
|
|
126
|
+
* are the next-best parses for caller inspection.
|
|
129
127
|
*
|
|
130
|
-
* Empty `classifierTopK` short-circuits to an empty tree at confidence 0 — no joint decode is
|
|
131
|
-
*
|
|
132
|
-
*
|
|
128
|
+
* Empty `classifierTopK` short-circuits to an empty tree at confidence 0 — no joint decode is possible without tag
|
|
129
|
+
* interpretations. Callers without top-k should use the runtime-pipeline fallback (which keeps classifier-emitted spans
|
|
130
|
+
* sorted by start).
|
|
133
131
|
*/
|
|
134
132
|
export declare function reconcileSpans(inputs: ReconcileInputs): ParseTree;
|
|
135
133
|
//# sourceMappingURL=reconcile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconcile.d.ts","sourceRoot":"","sources":["../../pipeline/reconcile.ts"],"names":[],"mappings":"AAAA;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