harumt 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.en.md +24 -21
- package/README.md +66 -73
- package/data/config/lookup_tables.toml +9 -4
- package/dist/analyzer/config.js +1 -3
- package/dist/analyzer/connect.d.ts +1 -1
- package/dist/analyzer/connect.js +2 -1
- package/dist/analyzer/dictionary-provider.d.ts +2 -0
- package/dist/analyzer/dictionary-provider.js +3 -0
- package/dist/analyzer/haru-dictionary-provider.js +17 -6
- package/dist/analyzer/node-dictionary-provider.d.ts +19 -8
- package/dist/analyzer/node-dictionary-provider.js +109 -48
- package/dist/analyzer/node-helpers.js +12 -18
- package/dist/analyzer/page-cached-source.d.ts +59 -0
- package/dist/analyzer/page-cached-source.js +157 -0
- package/dist/analyzer-lexicon.js +6 -1
- package/dist/default-provider.d.ts +1 -1
- package/dist/default-provider.js +14 -6
- package/dist/dictionary/derivation.d.ts +0 -1
- package/dist/dictionary/morpheme.js +13 -7
- package/dist/dictionary/pattern.js +1 -1
- package/dist/dictionary/sense-normalization.js +3 -3
- package/dist/generator/aux-map.d.ts +1 -0
- package/dist/generator/aux-map.js +1 -1
- package/dist/generator/conjugator.d.ts +0 -1
- package/dist/generator/conjugator.js +0 -3
- package/dist/generator/numerals.d.ts +0 -1
- package/dist/generator/numerals.js +0 -3
- package/dist/pipeline/assembler/affix-helpers.d.ts +14 -0
- package/dist/pipeline/assembler/affix-helpers.js +154 -0
- package/dist/pipeline/assembler/content-override.d.ts +3 -0
- package/dist/pipeline/assembler/content-override.js +79 -0
- package/dist/pipeline/assembler/copula-focus-plan.d.ts +10 -0
- package/dist/pipeline/assembler/copula-focus-plan.js +32 -0
- package/dist/pipeline/assembler/copula-helpers.d.ts +31 -0
- package/dist/pipeline/assembler/copula-helpers.js +192 -0
- package/dist/pipeline/assembler/lexical-layout-hypothesis.d.ts +59 -0
- package/dist/pipeline/assembler/lexical-layout-hypothesis.js +357 -0
- package/dist/pipeline/assembler/light-verb-projection.d.ts +21 -0
- package/dist/pipeline/assembler/light-verb-projection.js +43 -0
- package/dist/pipeline/assembler/nande-reason.d.ts +4 -0
- package/dist/pipeline/assembler/nande-reason.js +162 -0
- package/dist/pipeline/assembler/particle-helpers.d.ts +10 -0
- package/dist/pipeline/assembler/particle-helpers.js +57 -0
- package/dist/pipeline/assembler/quantity-spans.d.ts +24 -0
- package/dist/pipeline/assembler/quantity-spans.js +58 -0
- package/dist/pipeline/assembler/question-plan.d.ts +5 -0
- package/dist/pipeline/assembler/question-plan.js +121 -0
- package/dist/pipeline/assembler/quote-helpers.d.ts +11 -0
- package/dist/pipeline/assembler/quote-helpers.js +67 -0
- package/dist/pipeline/assembler.d.ts +47 -31
- package/dist/pipeline/assembler.js +1219 -3234
- package/dist/pipeline/assembly-content-span.d.ts +59 -0
- package/dist/pipeline/assembly-content-span.js +149 -0
- package/dist/pipeline/attributive.d.ts +2 -2
- package/dist/pipeline/attributive.js +2 -5
- package/dist/pipeline/candidate-runtime.d.ts +2 -30
- package/dist/pipeline/candidate-runtime.js +4 -125
- package/dist/pipeline/clause-layout/adverbial-predicate.d.ts +22 -0
- package/dist/pipeline/clause-layout/adverbial-predicate.js +180 -0
- package/dist/pipeline/clause-layout/attributive-boundaries.d.ts +12 -0
- package/dist/pipeline/clause-layout/attributive-boundaries.js +325 -0
- package/dist/pipeline/clause-layout/boundary-detection.d.ts +100 -0
- package/dist/pipeline/clause-layout/boundary-detection.js +729 -0
- package/dist/pipeline/clause-layout/boundary-event-common.d.ts +8 -0
- package/dist/pipeline/clause-layout/boundary-event-common.js +50 -0
- package/dist/pipeline/clause-layout/boundary-settlement.d.ts +40 -0
- package/dist/pipeline/clause-layout/boundary-settlement.js +534 -0
- package/dist/pipeline/clause-layout/chuushi-closure.js +1 -2
- package/dist/pipeline/clause-layout/connective-boundaries.d.ts +34 -0
- package/dist/pipeline/clause-layout/connective-boundaries.js +1049 -0
- package/dist/pipeline/clause-layout/final-layout.d.ts +155 -0
- package/dist/pipeline/clause-layout/final-layout.js +544 -0
- package/dist/pipeline/clause-layout/index.d.ts +5 -597
- package/dist/pipeline/clause-layout/index.js +69 -6576
- package/dist/pipeline/clause-layout/juncture-verdict.d.ts +1 -3
- package/dist/pipeline/clause-layout/layout-types.d.ts +142 -0
- package/dist/pipeline/clause-layout/layout-types.js +16 -0
- package/dist/pipeline/clause-layout/lexical-adverbial-affiliation.d.ts +1 -1
- package/dist/pipeline/clause-layout/navigation.d.ts +48 -0
- package/dist/pipeline/clause-layout/navigation.js +264 -0
- package/dist/pipeline/clause-layout/nominal-anchor-evidence.d.ts +57 -0
- package/dist/pipeline/clause-layout/nominal-anchor-evidence.js +180 -0
- package/dist/pipeline/clause-layout/nominal-anchors.d.ts +9 -0
- package/dist/pipeline/clause-layout/nominal-anchors.js +318 -0
- package/dist/pipeline/clause-layout/nominal-binding.d.ts +1 -1
- package/dist/pipeline/clause-layout/nominal-binding.js +1 -1
- package/dist/pipeline/clause-layout/nominal-frame-reach.d.ts +7 -0
- package/dist/pipeline/clause-layout/nominal-frame-reach.js +77 -0
- package/dist/pipeline/clause-layout/particle-phrase-copula.d.ts +1 -1
- package/dist/pipeline/clause-layout/phrase-enumeration.d.ts +1 -1
- package/dist/pipeline/clause-layout/phrase-enumeration.js +2 -1
- package/dist/pipeline/clause-layout/predicate-ownership.d.ts +22 -0
- package/dist/pipeline/clause-layout/predicate-ownership.js +323 -0
- package/dist/pipeline/clause-layout/predicate-parallel.d.ts +2 -1
- package/dist/pipeline/clause-layout/predicate-parallel.js +16 -1
- package/dist/pipeline/clause-layout/predicate-shape.d.ts +49 -0
- package/dist/pipeline/clause-layout/predicate-shape.js +369 -0
- package/dist/pipeline/clause-layout/predicate-token-shape.d.ts +15 -0
- package/dist/pipeline/clause-layout/predicate-token-shape.js +142 -0
- package/dist/pipeline/clause-layout/prenominal-head-reach.d.ts +29 -0
- package/dist/pipeline/clause-layout/prenominal-head-reach.js +349 -0
- package/dist/pipeline/clause-layout/proto-layout.d.ts +144 -0
- package/dist/pipeline/clause-layout/proto-layout.js +327 -0
- package/dist/pipeline/clause-layout/proto-state.d.ts +2 -1
- package/dist/pipeline/clause-layout/punctuated-copula.d.ts +1 -1
- package/dist/pipeline/clause-layout/punctuation.d.ts +8 -0
- package/dist/pipeline/clause-layout/punctuation.js +33 -0
- package/dist/pipeline/clause-layout/quote-classification.d.ts +48 -0
- package/dist/pipeline/clause-layout/quote-classification.js +430 -0
- package/dist/pipeline/clause-layout/quote-delimiters.d.ts +2 -0
- package/dist/pipeline/clause-layout/quote-delimiters.js +16 -0
- package/dist/pipeline/clause-layout/renyou-verb-reading.d.ts +1 -1
- package/dist/pipeline/clause-layout/speech-act.js +1 -1
- package/dist/pipeline/clause-layout/token-evidence.d.ts +11 -0
- package/dist/pipeline/clause-layout/token-evidence.js +41 -0
- package/dist/pipeline/clause-layout/trivia.d.ts +5 -0
- package/dist/pipeline/clause-layout/trivia.js +18 -1
- package/dist/pipeline/clause-layout/utterance-boundaries.d.ts +41 -0
- package/dist/pipeline/clause-layout/utterance-boundaries.js +627 -0
- package/dist/pipeline/clause-layout/vocative.d.ts +5 -0
- package/dist/pipeline/clause-layout/vocative.js +91 -0
- package/dist/pipeline/clause-layout/whitespace-attributive-reading.d.ts +1 -1
- package/dist/pipeline/clause-layout/whitespace-attributive-reading.js +4 -1
- package/dist/pipeline/commitment/adverbial-adjunct-routing.d.ts +3 -0
- package/dist/pipeline/commitment/adverbial-adjunct-routing.js +109 -0
- package/dist/pipeline/commitment/benefactive-span-hydration.d.ts +5 -0
- package/dist/pipeline/commitment/benefactive-span-hydration.js +49 -0
- package/dist/pipeline/commitment/candidate-projection.d.ts +29 -0
- package/dist/pipeline/commitment/candidate-projection.js +512 -0
- package/dist/pipeline/commitment/connective-refinement.d.ts +8 -0
- package/dist/pipeline/commitment/connective-refinement.js +152 -0
- package/dist/pipeline/commitment/deferred-reanalysis.d.ts +1 -1
- package/dist/pipeline/commitment/final-sense-sync.d.ts +8 -0
- package/dist/pipeline/commitment/final-sense-sync.js +264 -0
- package/dist/pipeline/commitment/head-owner-candidate-selection.d.ts +15 -0
- package/dist/pipeline/commitment/head-owner-candidate-selection.js +158 -0
- package/dist/pipeline/commitment/particle-roles.d.ts +1 -1
- package/dist/pipeline/commitment/particle-roles.js +546 -398
- package/dist/pipeline/commitment/passive-class.d.ts +1 -1
- package/dist/pipeline/commitment/passive-class.js +2 -3
- package/dist/pipeline/commitment/quantity-span-commitment.d.ts +4 -0
- package/dist/pipeline/commitment/quantity-span-commitment.js +37 -0
- package/dist/pipeline/commitment/quote-refinement.d.ts +6 -0
- package/dist/pipeline/commitment/quote-refinement.js +130 -0
- package/dist/pipeline/commitment/role-case-shadow.d.ts +0 -4
- package/dist/pipeline/commitment/role-case-shadow.js +0 -3
- package/dist/pipeline/commitment/semantic-frame.d.ts +1 -1
- package/dist/pipeline/commitment/semantic-frame.js +2 -3
- package/dist/pipeline/commitment/span-evidence.d.ts +2 -3
- package/dist/pipeline/commitment/span-evidence.js +7 -18
- package/dist/pipeline/commitment/stem-candidate-selection.d.ts +24 -0
- package/dist/pipeline/commitment/stem-candidate-selection.js +663 -0
- package/dist/pipeline/commitment/te-connective-resolution.d.ts +1 -1
- package/dist/pipeline/commitment/te-connective-resolution.js +0 -1
- package/dist/pipeline/commitment/types.d.ts +1 -1
- package/dist/pipeline/commitment/types.js +1 -1
- package/dist/pipeline/commitment/voice-reading-resolution.d.ts +1 -1
- package/dist/pipeline/commitment/voice-reading-resolution.js +117 -34
- package/dist/pipeline/compounds/compound-tail-tokens.d.ts +12 -0
- package/dist/pipeline/compounds/compound-tail-tokens.js +37 -0
- package/dist/pipeline/compounds/compound-translation-candidates.d.ts +49 -0
- package/dist/pipeline/compounds/compound-translation-candidates.js +154 -0
- package/dist/pipeline/compounds/compound-verbs.js +4 -9
- package/dist/pipeline/compounds/index.d.ts +24 -29
- package/dist/pipeline/compounds/index.js +361 -383
- package/dist/pipeline/content-resolver/postaux-pattern-rendering.d.ts +0 -2
- package/dist/pipeline/content-resolver/postaux-pattern-rendering.js +1 -5
- package/dist/pipeline/content-resolver/types.d.ts +0 -4
- package/dist/pipeline/content-resolver.js +641 -492
- package/dist/pipeline/context.d.ts +2 -1
- package/dist/pipeline/context.js +4 -3
- package/dist/pipeline/core.d.ts +8 -95
- package/dist/pipeline/core.js +1339 -7183
- package/dist/pipeline/deferred-commitment.d.ts +2 -17
- package/dist/pipeline/deferred-commitment.js +406 -2353
- package/dist/pipeline/demo-discourse.d.ts +1 -1
- package/dist/pipeline/fallback/index.d.ts +0 -1
- package/dist/pipeline/fallback/index.js +3 -7
- package/dist/pipeline/fallback/orphan-unit-absorption.d.ts +4 -0
- package/dist/pipeline/fallback/orphan-unit-absorption.js +57 -0
- package/dist/pipeline/fallback/unsupported-raw.d.ts +0 -2
- package/dist/pipeline/fallback/unsupported-raw.js +0 -10
- package/dist/pipeline/head-tail/boundary/clause-start.js +1 -10
- package/dist/pipeline/head-tail/boundary/ka-ownership.d.ts +3 -2
- package/dist/pipeline/head-tail/boundary/ka-ownership.js +16 -9
- package/dist/pipeline/head-tail/boundary/marker.js +1 -1
- package/dist/pipeline/head-tail/boundary/punctuation.d.ts +0 -1
- package/dist/pipeline/head-tail/boundary/punctuation.js +1 -6
- package/dist/pipeline/head-tail/boundary/quote-marker.js +1 -1
- package/dist/pipeline/head-tail/candidate/collect.d.ts +3 -3
- package/dist/pipeline/head-tail/candidate/context.d.ts +1 -1
- package/dist/pipeline/head-tail/candidate/context.js +1 -1
- package/dist/pipeline/head-tail/candidate/evidence.d.ts +0 -2
- package/dist/pipeline/head-tail/candidate/evidence.js +0 -22
- package/dist/pipeline/head-tail/candidate/owner-payload.d.ts +1 -1
- package/dist/pipeline/head-tail/candidate/semantic-classifiers.d.ts +2 -1
- package/dist/pipeline/head-tail/data/honorific-formulaic-arm-table.d.ts +0 -1
- package/dist/pipeline/head-tail/data/honorific-formulaic-arm-table.js +0 -3
- package/dist/pipeline/head-tail/data/quoted-reporting-sets.d.ts +2 -0
- package/dist/pipeline/head-tail/data/quoted-reporting-sets.js +4 -0
- package/dist/pipeline/head-tail/grammar.d.ts +0 -1
- package/dist/pipeline/head-tail/head/adapters/nominal/commit.js +3 -2
- package/dist/pipeline/head-tail/head/adapters/nominal/grammar.d.ts +2 -1
- package/dist/pipeline/head-tail/head/adapters/nominal/integration.d.ts +2 -2
- package/dist/pipeline/head-tail/head/adapters/nominal/integration.js +6 -6
- package/dist/pipeline/head-tail/head/adapters/nominal/owner-arbitration.d.ts +1 -1
- package/dist/pipeline/head-tail/head/adapters/nominal/parser.d.ts +1 -2
- package/dist/pipeline/head-tail/head/adapters/nominal/parser.js +20 -24
- package/dist/pipeline/head-tail/head/adapters/nominal/plan-lifecycle.d.ts +1 -1
- package/dist/pipeline/head-tail/head/adapters/nominal/renyou-nominal-head.js +2 -2
- package/dist/pipeline/head-tail/integration/content-head-dispatch.d.ts +5 -6
- package/dist/pipeline/head-tail/integration/content-head-dispatch.js +2 -5
- package/dist/pipeline/head-tail/integration/copula-focus-adjunct.js +1 -1
- package/dist/pipeline/head-tail/integration/copula-host-chain.js +1 -1
- package/dist/pipeline/head-tail/integration/honorific-formulaic-host.d.ts +25 -0
- package/dist/pipeline/head-tail/integration/honorific-formulaic-host.js +142 -0
- package/dist/pipeline/head-tail/integration/nominal-assembly.d.ts +2 -2
- package/dist/pipeline/head-tail/integration/nominal-assembly.js +1 -1
- package/dist/pipeline/head-tail/integration/particle-phrase-copula.d.ts +1 -1
- package/dist/pipeline/head-tail/integration/semantic-carrier-predicate.js +3 -20
- package/dist/pipeline/head-tail/integration/tail-assembly.d.ts +2 -3
- package/dist/pipeline/head-tail/integration/tail-assembly.js +20 -145
- package/dist/pipeline/head-tail/lifecycle/commit-context.d.ts +1 -1
- package/dist/pipeline/head-tail/lifecycle/head-tail-render-plan.d.ts +1 -1
- package/dist/pipeline/head-tail/lifecycle/hooks.d.ts +2 -3
- package/dist/pipeline/head-tail/lifecycle/hooks.js +0 -9
- package/dist/pipeline/head-tail/lifecycle/plan-context.d.ts +1 -1
- package/dist/pipeline/head-tail/lifecycle/plan-context.js +1 -1
- package/dist/pipeline/head-tail/lifecycle/registry.d.ts +3 -4
- package/dist/pipeline/head-tail/lifecycle/registry.js +1 -4
- package/dist/pipeline/head-tail/lifecycle/render.js +2 -2
- package/dist/pipeline/head-tail/line-memo.d.ts +1 -1
- package/dist/pipeline/head-tail/line-memo.js +25 -6
- package/dist/pipeline/head-tail/tail/chain.d.ts +3 -3
- package/dist/pipeline/head-tail/tail/families/tokoro-semantics.d.ts +0 -1
- package/dist/pipeline/head-tail/tail/families/tokoro-semantics.js +2 -1
- package/dist/pipeline/head-tail/tail/families/youda-semantics.js +1 -4
- package/dist/pipeline/head-tail/tail/postverb-events.d.ts +0 -180
- package/dist/pipeline/head-tail/tail/postverb-events.js +2 -2249
- package/dist/pipeline/head-tail/tail/postverb-tail-classifier.js +3 -4
- package/dist/pipeline/head-tail/tail/predicate-root/aspect-semantics.d.ts +10 -8
- package/dist/pipeline/head-tail/tail/predicate-root/aspect-semantics.js +2 -55
- package/dist/pipeline/head-tail/tail/predicate-root/benefactive-hydration.d.ts +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/benefactive-hydration.js +1 -18
- package/dist/pipeline/head-tail/tail/predicate-root/boundary-semantics.js +4 -2
- package/dist/pipeline/head-tail/tail/predicate-root/classifiers/causative-aux.d.ts +4 -0
- package/dist/pipeline/head-tail/tail/predicate-root/classifiers/causative-aux.js +11 -0
- package/dist/pipeline/head-tail/tail/predicate-root/classifiers/copula-concessive.d.ts +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/classifiers/copula-concessive.js +14 -3
- package/dist/pipeline/head-tail/tail/predicate-root/classifiers/tokens.d.ts +0 -2
- package/dist/pipeline/head-tail/tail/predicate-root/classifiers/tokens.js +3 -12
- package/dist/pipeline/head-tail/tail/predicate-root/commit.d.ts +2 -1
- package/dist/pipeline/head-tail/tail/predicate-root/commit.js +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/commitment-bridge.d.ts +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/connective-ops.d.ts +9 -0
- package/dist/pipeline/head-tail/tail/predicate-root/connective-ops.js +69 -0
- package/dist/pipeline/head-tail/tail/predicate-root/connective-render.d.ts +7 -0
- package/dist/pipeline/head-tail/tail/predicate-root/connective-render.js +52 -0
- package/dist/pipeline/head-tail/tail/predicate-root/connective-surface-lookup.d.ts +11 -0
- package/dist/pipeline/head-tail/tail/predicate-root/connective-surface-lookup.js +114 -0
- package/dist/pipeline/head-tail/tail/predicate-root/derivational-host-base.js +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/grammar.d.ts +2 -14
- package/dist/pipeline/head-tail/tail/predicate-root/grammar.js +19 -128
- package/dist/pipeline/head-tail/tail/predicate-root/head-contract-table.d.ts +2 -1
- package/dist/pipeline/head-tail/tail/predicate-root/head-contract-table.js +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/head-hydration.js +2 -17
- package/dist/pipeline/head-tail/tail/predicate-root/inspect.d.ts +2 -8
- package/dist/pipeline/head-tail/tail/predicate-root/inspect.js +12 -16
- package/dist/pipeline/head-tail/tail/predicate-root/integration/attributive-boundary.d.ts +35 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/attributive-boundary.js +1079 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/clause-boundaries.d.ts +69 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/clause-boundaries.js +2972 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/contracts.d.ts +118 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/end-boundary-inference.d.ts +22 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/end-boundary-inference.js +698 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/head-admission.d.ts +39 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/head-admission.js +689 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/head-profiles.d.ts +13 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/head-profiles.js +138 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/parse-clause.d.ts +60 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/parse-clause.js +2013 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/predicate-evidence.d.ts +15 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/predicate-evidence.js +109 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/predicate-start-evidence.d.ts +48 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/predicate-start-evidence.js +608 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/readiness.d.ts +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/integration/readiness.js +3 -2
- package/dist/pipeline/head-tail/tail/predicate-root/integration/stem-candidates.d.ts +177 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/stem-candidates.js +1885 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/tail-arbitration.d.ts +13 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/tail-arbitration.js +283 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/tail-chunk-scan-end.d.ts +8 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/tail-chunk-scan-end.js +389 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/zero-head.js +3 -2
- package/dist/pipeline/head-tail/tail/predicate-root/integration.d.ts +9 -166
- package/dist/pipeline/head-tail/tail/predicate-root/integration.js +254 -10644
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/connective-tail.d.ts +51 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/connective-tail.js +808 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/connective.d.ts +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/connective.js +5 -3
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/copula-tail.d.ts +22 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/copula-tail.js +156 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/copula.d.ts +8 -2
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/copula.js +177 -51
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/lexical-idioms.d.ts +37 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/lexical-idioms.js +959 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/likeness-modal.d.ts +15 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/likeness-modal.js +327 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/modal-tail.d.ts +44 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/modal-tail.js +998 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/obligation-tail.d.ts +20 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/obligation-tail.js +424 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/obligation.d.ts +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/obligation.js +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/postverb-operator.d.ts +25 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/postverb-operator.js +722 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/predicate-projection-connective.js +143 -9
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/predicate-quote.d.ts +44 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/predicate-quote.js +856 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/projection-tail.d.ts +45 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/projection-tail.js +573 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/quantity-extent.d.ts +2 -1
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/quantity-extent.js +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/te-aspect.d.ts +23 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/te-aspect.js +598 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/te-host.d.ts +11 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/te-host.js +52 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/terminal-sfp.d.ts +24 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/terminal-sfp.js +873 -0
- package/dist/pipeline/head-tail/tail/predicate-root/mid-chain-connective-license.js +2 -1
- package/dist/pipeline/head-tail/tail/predicate-root/nominal-host-phrase.d.ts +0 -1
- package/dist/pipeline/head-tail/tail/predicate-root/nominal-host-phrase.js +0 -3
- package/dist/pipeline/head-tail/tail/predicate-root/op-builders.d.ts +5 -1
- package/dist/pipeline/head-tail/tail/predicate-root/op-builders.js +21 -0
- package/dist/pipeline/head-tail/tail/predicate-root/operator-head.d.ts +1 -3
- package/dist/pipeline/head-tail/tail/predicate-root/operator-head.js +0 -16
- package/dist/pipeline/head-tail/tail/predicate-root/parse-boundary-hint.d.ts +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/parse-closure.d.ts +15 -0
- package/dist/pipeline/head-tail/tail/predicate-root/parse-closure.js +158 -0
- package/dist/pipeline/head-tail/tail/predicate-root/parse-coordinates.d.ts +10 -0
- package/dist/pipeline/head-tail/tail/predicate-root/parse-coordinates.js +29 -0
- package/dist/pipeline/head-tail/tail/predicate-root/parse-stem.d.ts +14 -0
- package/dist/pipeline/head-tail/tail/predicate-root/parse-stem.js +150 -0
- package/dist/pipeline/head-tail/tail/predicate-root/parse-tail.d.ts +40 -0
- package/dist/pipeline/head-tail/tail/predicate-root/parse-tail.js +1625 -0
- package/dist/pipeline/head-tail/tail/predicate-root/parser.d.ts +26 -137
- package/dist/pipeline/head-tail/tail/predicate-root/parser.js +153 -9225
- package/dist/pipeline/head-tail/tail/predicate-root/plan-lifecycle.d.ts +2 -2
- package/dist/pipeline/head-tail/tail/predicate-root/postverb-host-attachment.d.ts +8 -0
- package/dist/pipeline/head-tail/tail/predicate-root/postverb-host-attachment.js +105 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-admission-contract.js +261 -215
- package/dist/pipeline/head-tail/tail/predicate-root/production-claim-access.d.ts +0 -1
- package/dist/pipeline/head-tail/tail/predicate-root/production-claim-access.js +0 -3
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/attributive-change.d.ts +3 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/attributive-change.js +327 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/attributive.d.ts +54 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/attributive.js +1212 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/chain-patterns.d.ts +191 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/chain-patterns.js +127 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/clause-chain.d.ts +17 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/clause-chain.js +1071 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/conditional-carriers.d.ts +4 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/conditional-carriers.js +366 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/confirmation.d.ts +3 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/confirmation.js +289 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/copula.d.ts +8 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/copula.js +868 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/desiderative.d.ts +4 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/desiderative.js +414 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/exemplification.d.ts +2 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/exemplification.js +290 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/imperative.d.ts +6 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/imperative.js +468 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/mid-chain-quote.d.ts +4 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/mid-chain-quote.js +558 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/nominalization.d.ts +6 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/nominalization.js +332 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/nominalized-quote.d.ts +3 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/nominalized-quote.js +393 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/normalization.d.ts +7 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/normalization.js +334 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/potential.d.ts +3 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/potential.js +304 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/reason-and-sequence.d.ts +6 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/reason-and-sequence.js +687 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/request.d.ts +4 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/request.js +1013 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/shared.d.ts +25 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/shared.js +53 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/subordination.d.ts +5 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/subordination.js +318 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/terminal.d.ts +14 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/terminal.js +976 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/volitional.d.ts +10 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/volitional.js +677 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families.d.ts +1 -8
- package/dist/pipeline/head-tail/tail/predicate-root/production-families.js +19 -11025
- package/dist/pipeline/head-tail/tail/predicate-root/production-lowering-bindings.js +9 -3
- package/dist/pipeline/head-tail/tail/predicate-root/production-registry.d.ts +2 -3
- package/dist/pipeline/head-tail/tail/predicate-root/production-registry.js +15 -19
- package/dist/pipeline/head-tail/tail/predicate-root/quote-tail-context.d.ts +8 -0
- package/dist/pipeline/head-tail/tail/predicate-root/quote-tail-context.js +66 -0
- package/dist/pipeline/head-tail/tail/predicate-root/render-derivational-host-projection.d.ts +11 -0
- package/dist/pipeline/head-tail/tail/predicate-root/render-derivational-host-projection.js +67 -0
- package/dist/pipeline/head-tail/tail/predicate-root/render-root.d.ts +10 -0
- package/dist/pipeline/head-tail/tail/predicate-root/render-root.js +203 -0
- package/dist/pipeline/head-tail/tail/predicate-root/render-sfp-terminal.d.ts +3 -0
- package/dist/pipeline/head-tail/tail/predicate-root/render-sfp-terminal.js +647 -0
- package/dist/pipeline/head-tail/tail/predicate-root/render.d.ts +9 -25
- package/dist/pipeline/head-tail/tail/predicate-root/render.js +715 -5879
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/aspect-bases.d.ts +23 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/aspect-bases.js +523 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/aspect-benefactive.js +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/attributive-tail-forms.d.ts +71 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/attributive-tail-forms.js +907 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/aux-layer-context.d.ts +48 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/aux-layer-context.js +1 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/base-model.d.ts +3 -1
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/base-model.js +35 -1
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/base-support.d.ts +8 -1
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/base-support.js +90 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/command-render.d.ts +1 -13
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/command-render.js +3 -10
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/command-tail.d.ts +17 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/command-tail.js +439 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/conjecture-compose.d.ts +34 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/conjecture-compose.js +358 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/connective-compose.d.ts +2 -120
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/connective-compose.js +90 -1670
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/connective-ending.d.ts +7 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/connective-ending.js +36 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/continuative-copula.d.ts +7 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/continuative-copula.js +61 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/desire-bases.d.ts +9 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/desire-bases.js +69 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/hostless-conditional-quote.d.ts +12 -2
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/hostless-conditional-quote.js +19 -1
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/idiom-bases.d.ts +119 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/idiom-bases.js +393 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/modal-bases.d.ts +77 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/modal-bases.js +1243 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/non-chain-tail.d.ts +3 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/non-chain-tail.js +1045 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/noun-copula-attributive-forms.d.ts +38 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/noun-copula-attributive-forms.js +507 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/noun-copula-conjecture-compose.d.ts +5 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/noun-copula-conjecture-compose.js +108 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/noun-copula-tail-forms.d.ts +72 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/noun-copula-tail-forms.js +1343 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/noun-copula.js +9 -3
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/op-chain.js +1229 -1107
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/operator-chain-tail.d.ts +23 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/operator-chain-tail.js +443 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/postverb-auxiliary-bases.d.ts +12 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/postverb-auxiliary-bases.js +1193 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/predicate-base-projection.d.ts +18 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/predicate-base-projection.js +284 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/predicate-bases.d.ts +3 -271
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/predicate-bases.js +438 -5062
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/predicate-terminal-compose.d.ts +10 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/predicate-terminal-compose.js +167 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/purpose-manner-compose.d.ts +9 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/purpose-manner-compose.js +92 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/quote-complement-compose.d.ts +53 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/quote-complement-compose.js +534 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/reason-quote-carrier.js +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/scope-bridge-bases.d.ts +5 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/scope-bridge-bases.js +571 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/sequence-after-copula.js +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/sfp-question.d.ts +2 -1
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/sfp-question.js +9 -12
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/tail-host-trace.d.ts +15 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/tail-host-trace.js +134 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/voice-benefactive-bases.d.ts +41 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/voice-benefactive-bases.js +648 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/voice-benefactive-tail.d.ts +12 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/voice-benefactive-tail.js +306 -0
- package/dist/pipeline/head-tail/tail/predicate-root/span-provenance.d.ts +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/suffix-handoff.d.ts +0 -1
- package/dist/pipeline/head-tail/tail/predicate-root/suffix-handoff.js +0 -13
- package/dist/pipeline/head-tail/tail/predicate-root/tail-evidence-decision.d.ts +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/tail-evidence-decision.js +5 -45
- package/dist/pipeline/head-tail/tail/predicate-root/tame-reason-evidence.d.ts +8 -1
- package/dist/pipeline/head-tail/tail/predicate-root/tame-reason-evidence.js +15 -0
- package/dist/pipeline/head-tail/tail/predicate-root/trace.d.ts +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/trace.js +2 -1
- package/dist/pipeline/head-tail/tail/segments/nominal-frame.d.ts +1 -1
- package/dist/pipeline/head-tail/tail/te-tail-continuation-table.js +1 -3
- package/dist/pipeline/index.d.ts +0 -4
- package/dist/pipeline/lexical-nominal-head-claims.d.ts +1 -1
- package/dist/pipeline/lexical-particle-boundary-claims.d.ts +1 -1
- package/dist/pipeline/lexical-renyou-head-claims.d.ts +1 -1
- package/dist/pipeline/lexical-renyou-head-claims.js +1 -1
- package/dist/pipeline/lookup-tables.d.ts +1 -0
- package/dist/pipeline/lookup-tables.js +1 -0
- package/dist/pipeline/matchers.d.ts +0 -3
- package/dist/pipeline/matchers.js +1 -8
- package/dist/pipeline/particle-head-dispatch.d.ts +1 -1
- package/dist/pipeline/particle-head-dispatch.js +472 -442
- package/dist/pipeline/particles/index.d.ts +3 -3
- package/dist/pipeline/particles/secondary-particle.d.ts +1 -0
- package/dist/pipeline/particles/secondary-particle.js +4 -0
- package/dist/pipeline/pattern-runtime.d.ts +0 -61
- package/dist/pipeline/pattern-runtime.js +3 -684
- package/dist/pipeline/preprocess/analyzer-input-offsets.d.ts +5 -0
- package/dist/pipeline/preprocess/analyzer-input-offsets.js +23 -0
- package/dist/pipeline/preprocess/auxiliary-variant-retag.d.ts +7 -0
- package/dist/pipeline/preprocess/auxiliary-variant-retag.js +178 -0
- package/dist/pipeline/preprocess/bungo-nasal-n-retag.d.ts +9 -0
- package/dist/pipeline/preprocess/bungo-nasal-n-retag.js +318 -0
- package/dist/pipeline/preprocess/cat-meow.d.ts +4 -0
- package/dist/pipeline/preprocess/cat-meow.js +46 -0
- package/dist/pipeline/preprocess/causative-aux-lemma.d.ts +2 -0
- package/dist/pipeline/preprocess/causative-aux-lemma.js +10 -0
- package/dist/pipeline/preprocess/collapsed-aspect-aux.d.ts +3 -0
- package/dist/pipeline/preprocess/collapsed-aspect-aux.js +217 -0
- package/dist/pipeline/preprocess/collapsed-te-oku.d.ts +3 -0
- package/dist/pipeline/preprocess/collapsed-te-oku.js +210 -0
- package/dist/pipeline/preprocess/collocation-emission.d.ts +14 -0
- package/dist/pipeline/preprocess/collocation-emission.js +148 -0
- package/dist/pipeline/preprocess/colloquial-vowel-fusion.d.ts +4 -0
- package/dist/pipeline/preprocess/colloquial-vowel-fusion.js +164 -0
- package/dist/{transform → pipeline/preprocess}/compound-particle-merge.d.ts +2 -2
- package/dist/{transform → pipeline/preprocess}/compound-particle-merge.js +5 -5
- package/dist/pipeline/preprocess/copula-focus-negative-state-change.d.ts +3 -0
- package/dist/pipeline/preprocess/copula-focus-negative-state-change.js +79 -0
- package/dist/pipeline/preprocess/copula-renyou-retag.d.ts +3 -0
- package/dist/pipeline/preprocess/copula-renyou-retag.js +56 -0
- package/dist/pipeline/preprocess/emphasis-sokuon.d.ts +10 -0
- package/dist/pipeline/preprocess/emphasis-sokuon.js +182 -0
- package/dist/{transform → pipeline/preprocess}/explanatory-mon-sfp-retag.d.ts +1 -1
- package/dist/{transform → pipeline/preprocess}/explanatory-mon-sfp-retag.js +2 -2
- package/dist/pipeline/preprocess/follower-context.d.ts +7 -0
- package/dist/pipeline/preprocess/follower-context.js +33 -0
- package/dist/pipeline/preprocess/fused-conditional.d.ts +3 -0
- package/dist/pipeline/preprocess/fused-conditional.js +97 -0
- package/dist/pipeline/preprocess/imperative-mistag-recovery.d.ts +7 -0
- package/dist/pipeline/preprocess/imperative-mistag-recovery.js +135 -0
- package/dist/pipeline/preprocess/input-text-normalization.d.ts +3 -0
- package/dist/pipeline/preprocess/input-text-normalization.js +39 -0
- package/dist/pipeline/preprocess/kansai-dialect.d.ts +9 -0
- package/dist/pipeline/preprocess/kansai-dialect.js +501 -0
- package/dist/{transform → pipeline/preprocess}/keijouji-copula-de-retag.d.ts +1 -1
- package/dist/{transform → pipeline/preprocess}/keijouji-copula-de-retag.js +2 -2
- package/dist/{transform → pipeline/preprocess}/ni-complement-matrix-flip.d.ts +1 -1
- package/dist/{transform → pipeline/preprocess}/ni-complement-matrix-flip.js +2 -2
- package/dist/pipeline/preprocess/past-quotative-tte-resplit.d.ts +3 -0
- package/dist/pipeline/preprocess/past-quotative-tte-resplit.js +55 -0
- package/dist/pipeline/preprocess/prolonged-orthography.d.ts +5 -0
- package/dist/pipeline/preprocess/prolonged-orthography.js +79 -0
- package/dist/pipeline/preprocess/prolonged-surface-canonicalization.d.ts +5 -0
- package/dist/pipeline/preprocess/prolonged-surface-canonicalization.js +161 -0
- package/dist/pipeline/preprocess/punctuation-canonicalization.d.ts +5 -0
- package/dist/pipeline/preprocess/punctuation-canonicalization.js +160 -0
- package/dist/{transform → pipeline/preprocess}/quotative-manner-noun-flip.d.ts +2 -2
- package/dist/{transform → pipeline/preprocess}/quotative-manner-noun-flip.js +10 -10
- package/dist/{transform → pipeline/preprocess}/reduplicated-mimetic.d.ts +1 -1
- package/dist/{transform → pipeline/preprocess}/reduplicated-mimetic.js +3 -3
- package/dist/{transform → pipeline/preprocess}/rentaishi-no-nominalizer-retag.d.ts +1 -1
- package/dist/{transform → pipeline/preprocess}/rentaishi-no-nominalizer-retag.js +2 -2
- package/dist/pipeline/preprocess/runtime-token-from-analyzer.d.ts +5 -0
- package/dist/pipeline/preprocess/runtime-token-from-analyzer.js +77 -0
- package/dist/pipeline/preprocess/runtime-token-from-preprocess.d.ts +13 -0
- package/dist/pipeline/preprocess/runtime-token-from-preprocess.js +15 -0
- package/dist/pipeline/preprocess/standalone-voice-mark.d.ts +9 -0
- package/dist/pipeline/preprocess/standalone-voice-mark.js +73 -0
- package/dist/pipeline/preprocess/synthetic-token.d.ts +10 -0
- package/dist/pipeline/preprocess/synthetic-token.js +26 -0
- package/dist/pipeline/preprocess/te-contraction.d.ts +4 -0
- package/dist/pipeline/preprocess/te-contraction.js +150 -0
- package/dist/pipeline/preprocess/terminal-role-tail.d.ts +5 -0
- package/dist/pipeline/preprocess/terminal-role-tail.js +148 -0
- package/dist/{transform → pipeline/preprocess}/terminal-sfp-retag-closure.d.ts +2 -2
- package/dist/{transform → pipeline/preprocess}/terminal-sfp-retag-closure.js +4 -4
- package/dist/pipeline/preprocess/to-iu-contraction.d.ts +2 -0
- package/dist/pipeline/preprocess/to-iu-contraction.js +65 -0
- package/dist/{transform → pipeline/preprocess}/volitional-resolution-sfp-retag.d.ts +1 -1
- package/dist/{transform → pipeline/preprocess}/volitional-resolution-sfp-retag.js +2 -2
- package/dist/{transform → pipeline/preprocess}/youon-remerge.d.ts +1 -1
- package/dist/{transform → pipeline/preprocess}/youon-remerge.js +3 -3
- package/dist/pipeline/projection/narou-ruby-input.d.ts +17 -0
- package/dist/pipeline/projection/narou-ruby-input.js +149 -0
- package/dist/pipeline/projection/parenthetical-delimiter-annotation.d.ts +6 -0
- package/dist/pipeline/projection/parenthetical-delimiter-annotation.js +117 -0
- package/dist/pipeline/projection/parenthetical-ruby-absorption.d.ts +6 -0
- package/dist/pipeline/projection/parenthetical-ruby-absorption.js +198 -0
- package/dist/pipeline/projection/parenthetical-source-boundary.d.ts +12 -0
- package/dist/pipeline/projection/parenthetical-source-boundary.js +117 -0
- package/dist/pipeline/projection/parenthetical-source-identity.d.ts +14 -0
- package/dist/pipeline/projection/parenthetical-source-identity.js +443 -0
- package/dist/pipeline/projection/parenthetical-target-insertion.d.ts +22 -0
- package/dist/pipeline/projection/parenthetical-target-insertion.js +584 -0
- package/dist/pipeline/projection/prepared-translation.d.ts +52 -0
- package/dist/pipeline/projection/prepared-translation.js +1 -0
- package/dist/pipeline/projection/prepared-tree.d.ts +6 -0
- package/dist/pipeline/projection/prepared-tree.js +66 -0
- package/dist/pipeline/projection/raw-parenthetical-split.d.ts +15 -0
- package/dist/pipeline/projection/raw-parenthetical-split.js +78 -0
- package/dist/pipeline/projection/ruby-annotation.d.ts +5 -0
- package/dist/pipeline/projection/ruby-annotation.js +161 -0
- package/dist/pipeline/projection/text-offset-projection.d.ts +7 -0
- package/dist/pipeline/projection/text-offset-projection.js +111 -0
- package/dist/pipeline/projection/transparent-pause-island.d.ts +8 -0
- package/dist/pipeline/projection/transparent-pause-island.js +188 -0
- package/dist/pipeline/pronominal-no-dispatch.js +1 -1
- package/dist/pipeline/quote/host-runtime.js +3 -2
- package/dist/pipeline/quote/host-taxonomy.d.ts +1 -0
- package/dist/pipeline/quote/host-taxonomy.js +2 -2
- package/dist/pipeline/quote/question-taking-enumeration.d.ts +1 -1
- package/dist/pipeline/quote/question-taking-enumeration.js +0 -4
- package/dist/pipeline/reason-source-evidence.d.ts +1 -0
- package/dist/pipeline/reason-source-evidence.js +1 -1
- package/dist/pipeline/rendering/functional-chain.d.ts +2 -0
- package/dist/pipeline/rendering/functional-chain.js +14 -0
- package/dist/pipeline/rendering/nominal-head-tail-plan-trace.d.ts +10 -0
- package/dist/pipeline/rendering/nominal-head-tail-plan-trace.js +336 -0
- package/dist/pipeline/rendering/render-plan-inspect.d.ts +9 -0
- package/dist/pipeline/rendering/render-plan-inspect.js +121 -0
- package/dist/pipeline/rendering/render-plan-payloads.d.ts +28 -0
- package/dist/pipeline/rendering/render-plan-payloads.js +125 -0
- package/dist/pipeline/rendering/render-plan-rewrite.d.ts +32 -0
- package/dist/pipeline/rendering/render-plan-rewrite.js +540 -0
- package/dist/pipeline/rendering/render-plan-segments.d.ts +42 -0
- package/dist/pipeline/rendering/render-plan-segments.js +263 -0
- package/dist/pipeline/rendering/render-plan.d.ts +4 -57
- package/dist/pipeline/rendering/render-plan.js +52 -1433
- package/dist/pipeline/rendering/request-normalization.d.ts +0 -1
- package/dist/pipeline/rendering/request-normalization.js +0 -3
- package/dist/pipeline/rendering/segment-allomorph.d.ts +17 -0
- package/dist/pipeline/rendering/segment-allomorph.js +152 -0
- package/dist/pipeline/rendering/segment-annotation-keys.d.ts +6 -0
- package/dist/pipeline/rendering/segment-annotation-keys.js +137 -0
- package/dist/pipeline/rendering/stem-derivation.js +1 -1
- package/dist/pipeline/rendering/target-segment-build.d.ts +13 -0
- package/dist/pipeline/rendering/target-segment-build.js +167 -0
- package/dist/pipeline/rendering/terminal-unit-punctuation.d.ts +16 -0
- package/dist/pipeline/rendering/terminal-unit-punctuation.js +96 -0
- package/dist/pipeline/rendering/unit-surface.d.ts +9 -0
- package/dist/pipeline/rendering/unit-surface.js +35 -0
- package/dist/pipeline/resource-cache.d.ts +19 -0
- package/dist/pipeline/resource-cache.js +164 -0
- package/dist/pipeline/rules/common.d.ts +0 -1
- package/dist/pipeline/rules/common.js +0 -1
- package/dist/pipeline/rules/entry-aux.d.ts +0 -2
- package/dist/pipeline/rules/entry-aux.js +0 -4
- package/dist/pipeline/rules/postaux-unsupported.js +1 -5
- package/dist/pipeline/rules/pre-entry.d.ts +0 -1
- package/dist/pipeline/rules/pre-entry.js +0 -1
- package/dist/pipeline/rules/tail-finalization.js +4 -5
- package/dist/pipeline/semantics/conditional.d.ts +2 -1
- package/dist/pipeline/semantics/conditional.js +3 -2
- package/dist/pipeline/semantics/copula-tail-runtime.js +2 -2
- package/dist/pipeline/semantics/explanatory-mon-reading.d.ts +1 -1
- package/dist/pipeline/semantics/explanatory-mon-reading.js +2 -2
- package/dist/pipeline/semantics/extent-phrase.js +1 -1
- package/dist/pipeline/semantics/frame.d.ts +3 -3
- package/dist/pipeline/semantics/frame.js +4 -4
- package/dist/pipeline/semantics/gano-conversion.d.ts +1 -2
- package/dist/pipeline/semantics/gano-conversion.js +1 -9
- package/dist/pipeline/semantics/grammar-runtime.d.ts +0 -7
- package/dist/pipeline/semantics/grammar-runtime.js +0 -92
- package/dist/pipeline/semantics/honorific.d.ts +1 -2
- package/dist/pipeline/semantics/honorific.js +0 -3
- package/dist/pipeline/semantics/mono-modal.d.ts +1 -1
- package/dist/pipeline/semantics/numeric.js +1 -3
- package/dist/pipeline/semantics/sfp-surface.js +8 -0
- package/dist/pipeline/source-candidate-set.d.ts +1 -2
- package/dist/pipeline/source-candidate-set.js +0 -3
- package/dist/pipeline/source-coordinate.d.ts +20 -0
- package/dist/pipeline/source-coordinate.js +42 -0
- package/dist/pipeline/structural-relation/clause-connective-relations.d.ts +12 -0
- package/dist/pipeline/structural-relation/clause-connective-relations.js +327 -0
- package/dist/pipeline/structural-relation/collect.d.ts +1 -12
- package/dist/pipeline/structural-relation/collect.js +11 -3105
- package/dist/pipeline/structural-relation/connective-relation-match.d.ts +17 -0
- package/dist/pipeline/structural-relation/connective-relation-match.js +39 -0
- package/dist/pipeline/structural-relation/diagnostics.d.ts +0 -2
- package/dist/pipeline/structural-relation/diagnostics.js +0 -7
- package/dist/pipeline/structural-relation/ka-parallel-relations.d.ts +3 -0
- package/dist/pipeline/structural-relation/ka-parallel-relations.js +695 -0
- package/dist/pipeline/structural-relation/nari-relations.d.ts +3 -0
- package/dist/pipeline/structural-relation/nari-relations.js +367 -0
- package/dist/pipeline/structural-relation/parallel-item-evidence.d.ts +12 -0
- package/dist/pipeline/structural-relation/parallel-item-evidence.js +73 -0
- package/dist/pipeline/structural-relation/punctuated-attributive-relations.d.ts +2 -0
- package/dist/pipeline/structural-relation/punctuated-attributive-relations.js +224 -0
- package/dist/pipeline/structural-relation/purpose-relations.d.ts +7 -0
- package/dist/pipeline/structural-relation/purpose-relations.js +306 -0
- package/dist/pipeline/structural-relation/quote-clause-boundary.d.ts +47 -0
- package/dist/pipeline/structural-relation/quote-clause-boundary.js +216 -0
- package/dist/pipeline/structural-relation/quote-closed-toka.d.ts +22 -0
- package/dist/pipeline/structural-relation/quote-closed-toka.js +158 -0
- package/dist/pipeline/structural-relation/quote-content-endings.d.ts +20 -0
- package/dist/pipeline/structural-relation/quote-content-endings.js +163 -0
- package/dist/pipeline/structural-relation/quote-content-span.d.ts +23 -0
- package/dist/pipeline/structural-relation/quote-content-span.js +270 -0
- package/dist/pipeline/structural-relation/quote-nominal-and-passive.d.ts +22 -0
- package/dist/pipeline/structural-relation/quote-nominal-and-passive.js +724 -0
- package/dist/pipeline/structural-relation/quote-payload.d.ts +33 -0
- package/dist/pipeline/structural-relation/quote-payload.js +137 -0
- package/dist/pipeline/structural-relation/quote-question-content.d.ts +18 -0
- package/dist/pipeline/structural-relation/quote-question-content.js +588 -0
- package/dist/pipeline/structural-relation/quote-reason-copula.d.ts +18 -0
- package/dist/pipeline/structural-relation/quote-reason-copula.js +84 -0
- package/dist/pipeline/structural-relation/quote-relation-enrichment.d.ts +4 -0
- package/dist/pipeline/structural-relation/quote-relation-enrichment.js +174 -0
- package/dist/pipeline/structural-relation/quote-request.d.ts +16 -0
- package/dist/pipeline/structural-relation/quote-request.js +249 -0
- package/dist/pipeline/structural-relation/quote.d.ts +4 -130
- package/dist/pipeline/structural-relation/quote.js +105 -2627
- package/dist/pipeline/structural-relation/reason-relations.d.ts +6 -0
- package/dist/pipeline/structural-relation/reason-relations.js +328 -0
- package/dist/pipeline/structural-relation/relation-coordinates.d.ts +21 -0
- package/dist/pipeline/structural-relation/relation-coordinates.js +110 -0
- package/dist/pipeline/structural-relation/render-attributive.d.ts +25 -0
- package/dist/pipeline/structural-relation/render-attributive.js +195 -0
- package/dist/pipeline/structural-relation/render-clause-connective.d.ts +29 -0
- package/dist/pipeline/structural-relation/render-clause-connective.js +114 -0
- package/dist/pipeline/structural-relation/render-connective-plan.d.ts +28 -0
- package/dist/pipeline/structural-relation/render-connective-plan.js +164 -0
- package/dist/pipeline/structural-relation/render-parallel.d.ts +60 -0
- package/dist/pipeline/structural-relation/render-parallel.js +1088 -0
- package/dist/pipeline/structural-relation/render-quote.d.ts +75 -0
- package/dist/pipeline/structural-relation/render-quote.js +968 -0
- package/dist/pipeline/structural-relation/render-reason-copula.d.ts +24 -0
- package/dist/pipeline/structural-relation/render-reason-copula.js +324 -0
- package/dist/pipeline/structural-relation/render-source-sequence.d.ts +11 -0
- package/dist/pipeline/structural-relation/render-source-sequence.js +154 -0
- package/dist/pipeline/structural-relation/render-unit-spans.d.ts +35 -0
- package/dist/pipeline/structural-relation/render-unit-spans.js +71 -0
- package/dist/pipeline/structural-relation/render.d.ts +2 -25
- package/dist/pipeline/structural-relation/render.js +10 -3043
- package/dist/pipeline/structural-relation/source-predicate-operator.d.ts +2 -1
- package/dist/pipeline/structural-relation/tari-listing-relations.d.ts +5 -0
- package/dist/pipeline/structural-relation/tari-listing-relations.js +354 -0
- package/dist/pipeline/structural-relation/toka-nominal-listing-relations.d.ts +2 -0
- package/dist/pipeline/structural-relation/toka-nominal-listing-relations.js +154 -0
- package/dist/pipeline/structural-relation/toka-nominal-listing-run.d.ts +11 -1
- package/dist/pipeline/structural-relation/toka-nominal-listing-run.js +16 -4
- package/dist/pipeline/structural-relation/types.d.ts +10 -1
- package/dist/pipeline/translation/access.d.ts +0 -3
- package/dist/pipeline/translation/unit.d.ts +4 -1
- package/dist/pipeline/translation/unit.js +29 -9
- package/dist/pipeline/translation/warnings.d.ts +9 -0
- package/dist/pipeline/translation/warnings.js +251 -0
- package/dist/pipeline-factory.js +2 -1
- package/dist/scripts/diagnose.js +3 -2
- package/dist/types/pos.d.ts +3 -0
- package/dist/types/pos.js +8 -0
- package/dist/types/reanalysis.d.ts +0 -1
- package/dist/types/reanalysis.js +0 -1
- package/dist/types/render-plan.d.ts +1 -2
- package/dist/utils/char-class.d.ts +2 -0
- package/dist/utils/char-class.js +6 -0
- package/dist/utils/record.d.ts +1 -0
- package/dist/utils/record.js +3 -0
- package/dist/webext-provider.d.ts +7 -0
- package/dist/webext-provider.js +56 -16
- package/package.json +1 -1
- package/dist/pipeline/head-tail/audit/types.d.ts +0 -7
- /package/dist/pipeline/head-tail/{audit/types.js → tail/predicate-root/integration/contracts.js} +0 -0
|
@@ -0,0 +1,1088 @@
|
|
|
1
|
+
import { isNominalHeadTailChainRenderPlan, isPredicateHeadTailChainRenderPlan } from "../../types/render-plan.js";
|
|
2
|
+
import { isClauseEvidenceTransparentPunctuation, isClauseOpeningPunctuationToken } from "../clause-layout/punctuation.js";
|
|
3
|
+
import { attachParticleRenderPlan, particleKeyFromAllomorph } from "../rendering/particle-plan.js";
|
|
4
|
+
import { matchCopulaTailWithOptionalConditional } from "../semantics/copula-tail-runtime.js";
|
|
5
|
+
import { TokenCursor } from "../token-cursor.js";
|
|
6
|
+
import { CONNECTIVE_RENDER_MAP } from "../head-tail/tail/predicate-root/connective-render-table.js";
|
|
7
|
+
import { nominalPhraseOwnerPrefix } from "../head-tail/head/adapters/nominal/commit.js";
|
|
8
|
+
import { stemCandidateIdentitiesEqual, stemCandidateIdentity } from "../head-tail/tail/predicate-root/stem-candidate-identity.js";
|
|
9
|
+
import { UnitType } from "../translation/unit.js";
|
|
10
|
+
import { isNominalizedConjectureMatrixQuestionPlan, projectNominalizedConjectureMatrixQuestionContinuationPlan } from "./ka-parallel-plan.js";
|
|
11
|
+
import { asIrregular, conjugate } from "../../generator/conjugator.js";
|
|
12
|
+
import { POS0, 名詞, 代名詞, 補助記号, 記号, 대명사, 동사, 명사, 수사, 형용사, 구 } from "../../types/pos.js";
|
|
13
|
+
import { isTameReasonHeadContext } from "../attributive.js";
|
|
14
|
+
import { previousNonSpaceTokenIndex, sourceSpanForStructuralTokenSpan, unitIndexesInSpan, unitFullyCoveredBySpans, uniqueSorted, opSourceForMarkerSpans } from "./render-unit-spans.js";
|
|
15
|
+
import { composeRelationSourceUnitPlans, structuralRelationSequencePlan } from "./render-source-sequence.js";
|
|
16
|
+
import { projectUnitHeadTailConnectivePlan, projectHeadTailConnectivePlan, opSourceCoveredBy } from "./render-connective-plan.js";
|
|
17
|
+
export function buildBareKaQuestionContentStructuredRenderOperation(options) {
|
|
18
|
+
const quote = options.relation.quote;
|
|
19
|
+
if (quote?.slotKind !== "question_content" ||
|
|
20
|
+
(quote.questionBoundaryKind !== "bare_ka" && quote.questionBoundaryKind !== "nominalized_no_ka") ||
|
|
21
|
+
quote.contentPredicateIdx === undefined ||
|
|
22
|
+
quote.contentPredicateIdx === null) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const sourceUnitIndex = options.sourceUnitIndexes.find((unitIndex) => options.units[unitIndex]?.jpIndices.includes(quote.contentPredicateIdx) === true);
|
|
26
|
+
const sourceUnit = sourceUnitIndex === undefined ? undefined : options.units[sourceUnitIndex];
|
|
27
|
+
if (sourceUnitIndex === undefined || sourceUnit === undefined) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
const sourcePlan = sourceUnit.renderPlan;
|
|
31
|
+
if (quote.contentPredicateAnchorKind === "interrogative_head" && isPredicateHeadTailChainRenderPlan(sourcePlan)) {
|
|
32
|
+
const tail = sourcePlan.realization.root.tail;
|
|
33
|
+
const anchoredAtHead = tail.kind === "auxLayer" &&
|
|
34
|
+
tail.stem.semanticAnchors.some((anchor) => tail.stem.source.tokenIndices[anchor] === quote.contentPredicateIdx);
|
|
35
|
+
if (!anchoredAtHead) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const projectedPlan = projectNominalizedConjectureMatrixQuestionContinuationPlan(sourceUnit.renderPlan, quote.markerIdx, quote.markerBaseSurface) ?? normalizeConfirmedQuestionContentAlternativePlan(sourceUnit.renderPlan, quote.markerIdx, quote.markerBaseSurface) ?? projectUnitHeadTailConnectivePlan(sourceUnit, { connective: "question_content", surface: quote.markerBaseSurface }, opSourceForMarkerSpans(options.tokens, options.relation.markerSpans), true) ?? projectBareNounZeroCopulaQuestionContentPlan(sourceUnit.renderPlan, quote.contentPredicateAnchorKind, quote.markerBaseSurface) ?? projectNominalFrameQuestionContentPlan(sourceUnit.renderPlan, quote.markerBaseSurface) ?? (quote.contentPredicateAnchorKind === "zero_copula_nominal"
|
|
40
|
+
? null
|
|
41
|
+
: projectNominalQuestionContentPlan(sourceUnit.renderPlan));
|
|
42
|
+
if (projectedPlan === null) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
const suppressUnitIndexes = uniqueSorted(options.markerUnitIndexes.filter((unitIndex) => unitIndex !== sourceUnitIndex));
|
|
46
|
+
return {
|
|
47
|
+
relation: options.relation,
|
|
48
|
+
insertBeforeUnitIndex: sourceUnitIndex,
|
|
49
|
+
replaceUnitIndex: sourceUnitIndex,
|
|
50
|
+
suppressUnitIndexes,
|
|
51
|
+
sourceUnitIndexes: options.sourceUnitIndexes,
|
|
52
|
+
targetUnitIndexes: options.targetUnitIndexes,
|
|
53
|
+
projectionTokenIndexes: uniqueSorted([
|
|
54
|
+
...sourceUnit.jpIndices,
|
|
55
|
+
...suppressUnitIndexes.flatMap((unitIndex) => options.units[unitIndex]?.jpIndices ?? []),
|
|
56
|
+
]),
|
|
57
|
+
renderPlan: markStructuralKaParallelQuestionContentPlan(projectedPlan),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function projectBareNounZeroCopulaQuestionContentPlan(plan, anchorKind, markerSurface) {
|
|
61
|
+
if (anchorKind !== "zero_copula_nominal" || plan?.kind !== "lemma") {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
if (plan.koreanPos !== 명사 && plan.koreanPos !== 대명사 && plan.koreanPos !== 수사) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
const ending = CONNECTIVE_RENDER_MAP.get(markerSurface)?.korean;
|
|
68
|
+
if (ending === undefined) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
const { connective: _legacyConnective, suffix: _legacySuffix, ...head } = plan;
|
|
72
|
+
return { ...head, connective: ending, sfp: null, terminalSfp: null };
|
|
73
|
+
}
|
|
74
|
+
function projectNominalFrameQuestionContentPlan(plan, markerSurface) {
|
|
75
|
+
if (!isNominalHeadTailChainRenderPlan(plan) || plan.realization.frame.projection.kind !== "headLexicalForm") {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
const ending = CONNECTIVE_RENDER_MAP.get(markerSurface)?.korean;
|
|
79
|
+
if (ending === undefined) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
const headText = nominalPhraseOwnerPrefix(plan, "");
|
|
83
|
+
if (headText.length === 0) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
const hintPos = plan.realization.root.kind === "nominalPhrase"
|
|
87
|
+
? plan.realization.root.head.allomorphHint?.koreanPos
|
|
88
|
+
: undefined;
|
|
89
|
+
return {
|
|
90
|
+
kind: "lemma",
|
|
91
|
+
entry: null,
|
|
92
|
+
koreanLemma: headText,
|
|
93
|
+
koreanPos: hintPos === 대명사 ? 대명사 : 명사,
|
|
94
|
+
irregular: null,
|
|
95
|
+
auxTokens: [],
|
|
96
|
+
connective: ending,
|
|
97
|
+
sfp: null,
|
|
98
|
+
terminalSfp: null,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function projectNominalQuestionContentPlan(plan) {
|
|
102
|
+
if (plan?.kind === "fixedText") {
|
|
103
|
+
return structuralRelationSequencePlan([
|
|
104
|
+
plan,
|
|
105
|
+
{ kind: "structuralText", text: "인지", koreanPos: 구 },
|
|
106
|
+
]);
|
|
107
|
+
}
|
|
108
|
+
if (plan?.kind === "registerText") {
|
|
109
|
+
return structuralRelationSequencePlan([
|
|
110
|
+
plan,
|
|
111
|
+
{ kind: "structuralText", text: "인지", koreanPos: 구 },
|
|
112
|
+
]);
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
function normalizeConfirmedQuestionContentAlternativePlan(plan, markerIdx, markerSurface) {
|
|
117
|
+
if (!isPredicateHeadTailChainRenderPlan(plan) || plan.realization.root.tail.kind !== "auxLayer") {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
const alternative = plan.realization.root.tail.ops.find((op) => op.kind === "connective" &&
|
|
121
|
+
op.connective === "alternative" &&
|
|
122
|
+
op.source.tokenIndices.includes(markerIdx));
|
|
123
|
+
if (alternative === undefined) {
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
return projectHeadTailConnectivePlan(plan, { connective: "question_content", surface: markerSurface }, alternative.source, true);
|
|
127
|
+
}
|
|
128
|
+
function sourceTokensOverlap(left, right) {
|
|
129
|
+
if (left.sourceSpan !== undefined && left.sourceSpan !== null && right.sourceSpan !== undefined && right.sourceSpan !== null) {
|
|
130
|
+
return left.sourceSpan.startOrdinal < right.sourceSpan.endOrdinal &&
|
|
131
|
+
right.sourceSpan.startOrdinal < left.sourceSpan.endOrdinal;
|
|
132
|
+
}
|
|
133
|
+
return left.sourceOrdinal !== undefined &&
|
|
134
|
+
right.sourceOrdinal !== undefined &&
|
|
135
|
+
left.sourceOrdinal === right.sourceOrdinal;
|
|
136
|
+
}
|
|
137
|
+
export function buildKaParallelStructuredRenderOperation(options) {
|
|
138
|
+
const payload = options.relation.kaParallel;
|
|
139
|
+
const minimumItemCount = options.relation.kind === "toka_parallel_listing" ? 1 : 2;
|
|
140
|
+
if (payload === undefined || payload.itemAnchors.length < minimumItemCount) {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
const explicitTerminalPunctuation = payload.terminalPunctuation;
|
|
144
|
+
const matrixQuestionItems = payload.matrixQuestionItems;
|
|
145
|
+
const yieldsLastItemToTerminalOwner = payload.terminalOwnerBoundary !== undefined;
|
|
146
|
+
const projectedItems = yieldsLastItemToTerminalOwner
|
|
147
|
+
? payload.itemAnchors.slice(0, -1)
|
|
148
|
+
: payload.itemAnchors;
|
|
149
|
+
if (projectedItems.length === 0)
|
|
150
|
+
return null;
|
|
151
|
+
if (relationWindowHasExternalBoundarySymbol(options.tokens, options.units, options.relation.source.span.start, yieldsLastItemToTerminalOwner
|
|
152
|
+
? projectedItems.at(-1).markerSpan.endExclusive
|
|
153
|
+
: payload.itemAnchors.at(-1)?.markerSpan.start ?? options.relation.source.span.endExclusive))
|
|
154
|
+
return null;
|
|
155
|
+
const itemPlans = [];
|
|
156
|
+
for (const [itemIndex, item] of projectedItems.entries()) {
|
|
157
|
+
const isLastItem = !yieldsLastItemToTerminalOwner && itemIndex === projectedItems.length - 1;
|
|
158
|
+
const plan = kaParallelItemPlan(options.tokens, options.units, item, options.relation.kind, isLastItem, payload.closure, yieldsLastItemToTerminalOwner ? false : matrixQuestionItems);
|
|
159
|
+
if (plan === null) {
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
itemPlans.push(plan);
|
|
163
|
+
}
|
|
164
|
+
const trailingSuffix = yieldsLastItemToTerminalOwner
|
|
165
|
+
? {
|
|
166
|
+
suffix: payload.separatorSpans.length > 0 ? "," : null,
|
|
167
|
+
suffixUnitIndexes: payload.separatorSpans.flatMap((span) => unitIndexesInSpan(options.units, span)),
|
|
168
|
+
}
|
|
169
|
+
: kaParallelTrailingSuffixPlan(options.tokens, options.units, options.sourceUnitIndexes, options.relation.source.span.endExclusive, options.lookups, payload.closure);
|
|
170
|
+
const projectedSourceSpan = yieldsLastItemToTerminalOwner
|
|
171
|
+
? {
|
|
172
|
+
start: projectedItems[0].source.span.start,
|
|
173
|
+
endExclusive: projectedItems.at(-1).markerSpan.endExclusive,
|
|
174
|
+
}
|
|
175
|
+
: options.relation.source.span;
|
|
176
|
+
const relationSourceUnitIndexes = yieldsLastItemToTerminalOwner
|
|
177
|
+
? unitIndexesInSpan(options.units, projectedSourceSpan)
|
|
178
|
+
: options.sourceUnitIndexes;
|
|
179
|
+
const relationMarkerUnitIndexes = yieldsLastItemToTerminalOwner
|
|
180
|
+
? projectedItems.flatMap((item) => unitIndexesInSpan(options.units, item.markerSpan))
|
|
181
|
+
: options.markerUnitIndexes;
|
|
182
|
+
const internalSymbolUnitIndexes = unitIndexesInSpan(options.units, options.relation.source.span)
|
|
183
|
+
.filter((unitIndex) => options.units[unitIndex]?.unitType === UnitType.SYMBOL &&
|
|
184
|
+
options.units[unitIndex].jpIndices.some((jpIndex) => jpIndex >= projectedSourceSpan.start && jpIndex < projectedSourceSpan.endExclusive));
|
|
185
|
+
const ownedSourceUnitIndexes = uniqueSorted([
|
|
186
|
+
...relationSourceUnitIndexes,
|
|
187
|
+
...internalSymbolUnitIndexes,
|
|
188
|
+
]);
|
|
189
|
+
const suppressUnitIndexes = uniqueSorted([
|
|
190
|
+
...ownedSourceUnitIndexes,
|
|
191
|
+
...relationMarkerUnitIndexes,
|
|
192
|
+
...trailingSuffix.suffixUnitIndexes,
|
|
193
|
+
]);
|
|
194
|
+
const insertBeforeUnitIndex = suppressUnitIndexes[0] ?? options.sourceUnitIndexes[0] ?? null;
|
|
195
|
+
if (insertBeforeUnitIndex === null) {
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
const terminalOwnerPlanReplacements = payload.terminalOwnerBoundary === "matrix_terminal_question"
|
|
199
|
+
? kaParallelTerminalOwnerPlanReplacement(options.units, payload.itemAnchors.at(-1))
|
|
200
|
+
: [];
|
|
201
|
+
return {
|
|
202
|
+
relation: options.relation,
|
|
203
|
+
insertBeforeUnitIndex,
|
|
204
|
+
suppressUnitIndexes,
|
|
205
|
+
sourceUnitIndexes: ownedSourceUnitIndexes,
|
|
206
|
+
targetUnitIndexes: yieldsLastItemToTerminalOwner ? [] : options.targetUnitIndexes,
|
|
207
|
+
unitRenderPlanReplacements: terminalOwnerPlanReplacements,
|
|
208
|
+
projectionTokenIndexes: uniqueSorted(suppressUnitIndexes.flatMap((candidateIndex) => (options.units[candidateIndex]?.jpIndices ?? []))),
|
|
209
|
+
renderPlan: {
|
|
210
|
+
kind: "kaParallel",
|
|
211
|
+
relationKind: options.relation.kind === "ka_parallel_choice" ? "choice" : "question_content",
|
|
212
|
+
itemPlans,
|
|
213
|
+
itemSourceSpans: projectedItems.map((item) => sourceSpanForStructuralTokenSpan(options.tokens, item.source.span)),
|
|
214
|
+
markerSourceSpans: projectedItems.map((item) => sourceSpanForStructuralTokenSpan(options.tokens, item.markerSpan)),
|
|
215
|
+
separator: payload.separatorSpans.length > 0 ? "comma" : "space",
|
|
216
|
+
terminalPunctuation: yieldsLastItemToTerminalOwner ? null : explicitTerminalPunctuation,
|
|
217
|
+
terminalPunctuationRun: yieldsLastItemToTerminalOwner ? [] : payload.terminalPunctuationRun,
|
|
218
|
+
...(trailingSuffix.suffix === null ? {} : { suffix: trailingSuffix.suffix }),
|
|
219
|
+
koreanPos: 구,
|
|
220
|
+
},
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
function kaParallelTerminalOwnerPlanReplacement(units, item) {
|
|
224
|
+
const unitIndexes = unitIndexesInSpan(units, item.source.span);
|
|
225
|
+
const predicateUnitIndex = parallelPredicateUnitIndex(units, unitIndexes, item.predicateIdx);
|
|
226
|
+
if (predicateUnitIndex === null)
|
|
227
|
+
return [];
|
|
228
|
+
const plan = units[predicateUnitIndex]?.renderPlan;
|
|
229
|
+
if (plan === undefined || plan === null)
|
|
230
|
+
return [];
|
|
231
|
+
return [{ unitIndex: predicateUnitIndex, renderPlan: markQuestionContentTerminalPlan(plan) }];
|
|
232
|
+
}
|
|
233
|
+
export function buildEmbeddedQuestionAttributiveQuoteStructuredRenderOperation(options) {
|
|
234
|
+
const payload = options.relation.embeddedQuestionAttributiveQuote;
|
|
235
|
+
if (payload === undefined)
|
|
236
|
+
return null;
|
|
237
|
+
const itemPlan = kaParallelItemPlan(options.tokens, options.units, payload.item, options.relation.kind, true, payload.closure, false);
|
|
238
|
+
if (itemPlan === null)
|
|
239
|
+
return null;
|
|
240
|
+
const suffixUnitIndexes = unitIndexesInSpan(options.units, payload.closure.markerSpan);
|
|
241
|
+
if (suffixUnitIndexes.length === 0)
|
|
242
|
+
return null;
|
|
243
|
+
const sourceUnitIndexSet = new Set(options.sourceUnitIndexes);
|
|
244
|
+
const closureEscapesMarkerSpan = suffixUnitIndexes.some((unitIndex) => {
|
|
245
|
+
if (sourceUnitIndexSet.has(unitIndex))
|
|
246
|
+
return false;
|
|
247
|
+
const unit = options.units[unitIndex];
|
|
248
|
+
return unit === undefined || !unitFullyCoveredBySpans(unit, [payload.closure.markerSpan]);
|
|
249
|
+
});
|
|
250
|
+
if (closureEscapesMarkerSpan)
|
|
251
|
+
return null;
|
|
252
|
+
const particleUnitIndexes = payload.closure.particleSpan === undefined
|
|
253
|
+
? []
|
|
254
|
+
: unitIndexesInSpan(options.units, payload.closure.particleSpan);
|
|
255
|
+
const suffix = payload.closure.realization === "light_koto"
|
|
256
|
+
? " 하는"
|
|
257
|
+
: payload.closure.realization === "pronominal_no" ? "라는 것" : "라는";
|
|
258
|
+
const sequencePlan = structuralRelationSequencePlan([
|
|
259
|
+
itemPlan,
|
|
260
|
+
{
|
|
261
|
+
kind: "structuralText",
|
|
262
|
+
text: suffix,
|
|
263
|
+
koreanPos: 구,
|
|
264
|
+
sourceSpan: sourceSpanForStructuralTokenSpan(options.tokens, payload.closure.markerSpan),
|
|
265
|
+
},
|
|
266
|
+
]);
|
|
267
|
+
if (sequencePlan === null)
|
|
268
|
+
return null;
|
|
269
|
+
const trailingParticle = particleUnitIndexes
|
|
270
|
+
.map((unitIndex) => options.units[unitIndex]?.allomorphKey ?? null)
|
|
271
|
+
.map((key) => key === null ? null : particleKeyFromAllomorph(key))
|
|
272
|
+
.find((key) => key !== null) ?? null;
|
|
273
|
+
const renderPlan = payload.closure.realization === "pronominal_no" && trailingParticle !== null
|
|
274
|
+
? attachParticleRenderPlan(sequencePlan, trailingParticle)
|
|
275
|
+
: sequencePlan;
|
|
276
|
+
if (renderPlan === null)
|
|
277
|
+
return null;
|
|
278
|
+
const suppressUnitIndexes = uniqueSorted([
|
|
279
|
+
...options.sourceUnitIndexes,
|
|
280
|
+
...options.markerUnitIndexes,
|
|
281
|
+
...suffixUnitIndexes,
|
|
282
|
+
...particleUnitIndexes,
|
|
283
|
+
]).filter((unitIndex) => options.units[unitIndex]?.unitType !== UnitType.SYMBOL);
|
|
284
|
+
const insertBeforeUnitIndex = suppressUnitIndexes[0] ?? null;
|
|
285
|
+
if (insertBeforeUnitIndex === null)
|
|
286
|
+
return null;
|
|
287
|
+
return {
|
|
288
|
+
relation: options.relation,
|
|
289
|
+
insertBeforeUnitIndex,
|
|
290
|
+
suppressUnitIndexes,
|
|
291
|
+
sourceUnitIndexes: options.sourceUnitIndexes,
|
|
292
|
+
targetUnitIndexes: options.targetUnitIndexes,
|
|
293
|
+
projectionTokenIndexes: uniqueSorted(suppressUnitIndexes.flatMap((unitIndex) => (options.units[unitIndex]?.jpIndices ?? []))),
|
|
294
|
+
renderPlan,
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
function relationWindowHasExternalBoundarySymbol(tokens, units, start, endExclusive) {
|
|
298
|
+
return units.some((unit) => unit.unitType === UnitType.SYMBOL &&
|
|
299
|
+
unit.jpIndices.some((jpIndex) => {
|
|
300
|
+
if (jpIndex < start || jpIndex >= endExclusive)
|
|
301
|
+
return false;
|
|
302
|
+
const token = tokens[jpIndex];
|
|
303
|
+
return token !== undefined &&
|
|
304
|
+
!isClauseOpeningPunctuationToken(token) &&
|
|
305
|
+
!isClauseEvidenceTransparentPunctuation(token);
|
|
306
|
+
}));
|
|
307
|
+
}
|
|
308
|
+
export function buildNariParallelStructuredRenderOperation(options) {
|
|
309
|
+
const payload = options.relation.nariParallel;
|
|
310
|
+
if (payload === undefined || payload.itemAnchors.length < 2) {
|
|
311
|
+
return null;
|
|
312
|
+
}
|
|
313
|
+
const itemPlans = [];
|
|
314
|
+
for (const item of payload.itemAnchors) {
|
|
315
|
+
if (nariItemSpanContainsTransparentPunctuation(options.tokens, item.source.span)) {
|
|
316
|
+
return null;
|
|
317
|
+
}
|
|
318
|
+
const plan = nariParallelItemPlan(options.tokens, options.units, item, item.itemKind);
|
|
319
|
+
if (plan === null) {
|
|
320
|
+
return null;
|
|
321
|
+
}
|
|
322
|
+
itemPlans.push(plan);
|
|
323
|
+
}
|
|
324
|
+
const trailingParticle = nariParallelTrailingParticleKey(options.units, payload.trailingParticleSpan ?? null);
|
|
325
|
+
const consumeTrailing = payload.trailingParticleSpan !== null &&
|
|
326
|
+
payload.trailingParticleSpan !== undefined && trailingParticle !== null;
|
|
327
|
+
const unconsumedTrailingUnitIndexes = consumeTrailing || payload.trailingParticleSpan === null || payload.trailingParticleSpan === undefined
|
|
328
|
+
? []
|
|
329
|
+
: unitIndexesInSpan(options.units, payload.trailingParticleSpan);
|
|
330
|
+
const suppressUnitIndexes = uniqueSorted([...options.sourceUnitIndexes, ...options.markerUnitIndexes])
|
|
331
|
+
.filter((unitIndex) => !unconsumedTrailingUnitIndexes.includes(unitIndex));
|
|
332
|
+
const insertBeforeUnitIndex = suppressUnitIndexes[0] ?? options.sourceUnitIndexes[0] ?? null;
|
|
333
|
+
if (insertBeforeUnitIndex === null) {
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
336
|
+
return {
|
|
337
|
+
relation: options.relation,
|
|
338
|
+
insertBeforeUnitIndex,
|
|
339
|
+
suppressUnitIndexes,
|
|
340
|
+
sourceUnitIndexes: options.sourceUnitIndexes,
|
|
341
|
+
targetUnitIndexes: options.targetUnitIndexes,
|
|
342
|
+
projectionTokenIndexes: uniqueSorted(suppressUnitIndexes.flatMap((candidateIndex) => (options.units[candidateIndex]?.jpIndices ?? []))),
|
|
343
|
+
renderPlan: {
|
|
344
|
+
kind: "nariParallel",
|
|
345
|
+
itemKind: payload.itemKind,
|
|
346
|
+
itemKinds: payload.itemAnchors.map((item) => item.itemKind),
|
|
347
|
+
itemPlans,
|
|
348
|
+
itemSourceSpans: payload.itemAnchors.map((item) => sourceSpanForStructuralTokenSpan(options.tokens, item.source.span)),
|
|
349
|
+
markerSourceSpans: payload.markerSpans.map((span) => sourceSpanForStructuralTokenSpan(options.tokens, span)),
|
|
350
|
+
separator: payload.separatorSpans.length > 0 ? "comma" : "space",
|
|
351
|
+
...(consumeTrailing && trailingParticle !== null ? { trailingParticle } : {}),
|
|
352
|
+
koreanPos: 구,
|
|
353
|
+
},
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
export function buildTokaNominalListingStructuredRenderOperation(options) {
|
|
357
|
+
const payload = options.relation.tokaNominalListing;
|
|
358
|
+
if (payload === undefined || payload.itemAnchors.length < 2) {
|
|
359
|
+
return null;
|
|
360
|
+
}
|
|
361
|
+
const itemPlans = [];
|
|
362
|
+
const relationCoreSpans = [
|
|
363
|
+
...payload.itemAnchors.map((item) => item.span),
|
|
364
|
+
...options.relation.markerSpans,
|
|
365
|
+
...payload.separatorSpans,
|
|
366
|
+
];
|
|
367
|
+
if (tokaNominalListingHasUnownedSourceGap(options.tokens, relationCoreSpans)) {
|
|
368
|
+
return null;
|
|
369
|
+
}
|
|
370
|
+
const itemUnitIndexesForSuppression = [];
|
|
371
|
+
for (const item of payload.itemAnchors) {
|
|
372
|
+
if (nariItemSpanContainsTransparentPunctuation(options.tokens, item.span)) {
|
|
373
|
+
return null;
|
|
374
|
+
}
|
|
375
|
+
const itemUnitIndexes = unitIndexesInSpan(options.units, item.span);
|
|
376
|
+
if (itemUnitIndexes.some((unitIndex) => {
|
|
377
|
+
const unit = options.units[unitIndex];
|
|
378
|
+
return unit === undefined || !unitFullyCoveredBySpans(unit, [item.span]);
|
|
379
|
+
})) {
|
|
380
|
+
return null;
|
|
381
|
+
}
|
|
382
|
+
const itemPlan = composeRelationSourceUnitPlans(options.tokens, options.units, itemUnitIndexes);
|
|
383
|
+
if (itemPlan === null) {
|
|
384
|
+
return null;
|
|
385
|
+
}
|
|
386
|
+
itemUnitIndexesForSuppression.push(...itemUnitIndexes);
|
|
387
|
+
itemPlans.push(itemPlan);
|
|
388
|
+
}
|
|
389
|
+
const trailingParticle = payload.closure === "closed"
|
|
390
|
+
? nariParallelTrailingParticleKey(options.units, payload.trailingParticleSpan)
|
|
391
|
+
: null;
|
|
392
|
+
const consumeTrailing = payload.closure === "closed" &&
|
|
393
|
+
payload.trailingParticleSpan !== null && trailingParticle !== null;
|
|
394
|
+
const unconsumedTrailingUnitIndexes = !consumeTrailing && payload.trailingParticleSpan !== null
|
|
395
|
+
? unitIndexesInSpan(options.units, payload.trailingParticleSpan)
|
|
396
|
+
: [];
|
|
397
|
+
const suppressUnitIndexes = uniqueSorted([
|
|
398
|
+
...options.sourceUnitIndexes,
|
|
399
|
+
...options.markerUnitIndexes,
|
|
400
|
+
...itemUnitIndexesForSuppression,
|
|
401
|
+
]).filter((unitIndex) => !unconsumedTrailingUnitIndexes.includes(unitIndex));
|
|
402
|
+
const suppressibleSpans = [
|
|
403
|
+
...payload.itemAnchors.map((item) => item.span),
|
|
404
|
+
...options.relation.markerSpans,
|
|
405
|
+
...payload.separatorSpans,
|
|
406
|
+
...(consumeTrailing && payload.trailingParticleSpan !== null
|
|
407
|
+
? [payload.trailingParticleSpan]
|
|
408
|
+
: []),
|
|
409
|
+
];
|
|
410
|
+
if (suppressUnitIndexes.some((unitIndex) => {
|
|
411
|
+
const unit = options.units[unitIndex];
|
|
412
|
+
return unit === undefined || !unitFullyCoveredBySpans(unit, suppressibleSpans);
|
|
413
|
+
})) {
|
|
414
|
+
return null;
|
|
415
|
+
}
|
|
416
|
+
const insertBeforeUnitIndex = suppressUnitIndexes[0] ?? options.sourceUnitIndexes[0] ?? null;
|
|
417
|
+
if (insertBeforeUnitIndex === null) {
|
|
418
|
+
return null;
|
|
419
|
+
}
|
|
420
|
+
return {
|
|
421
|
+
relation: consumeTrailing || payload.trailingParticleSpan === null
|
|
422
|
+
? options.relation
|
|
423
|
+
: tokaNominalListingRelationWithoutTrailingParticle(options.relation),
|
|
424
|
+
insertBeforeUnitIndex,
|
|
425
|
+
suppressUnitIndexes,
|
|
426
|
+
sourceUnitIndexes: suppressUnitIndexes,
|
|
427
|
+
targetUnitIndexes: options.targetUnitIndexes,
|
|
428
|
+
projectionTokenIndexes: uniqueSorted(suppressUnitIndexes.flatMap((candidateIndex) => (options.units[candidateIndex]?.jpIndices ?? []))),
|
|
429
|
+
...(consumeTrailing && payload.trailingParticleSpan !== null
|
|
430
|
+
? { projectionHeadTokenIndex: payload.trailingParticleSpan.start }
|
|
431
|
+
: {}),
|
|
432
|
+
renderPlan: {
|
|
433
|
+
kind: "nariParallel",
|
|
434
|
+
itemKind: "nominal",
|
|
435
|
+
itemPlans,
|
|
436
|
+
itemSourceSpans: payload.itemAnchors.map((item) => sourceSpanForStructuralTokenSpan(options.tokens, item.span)),
|
|
437
|
+
markerSourceSpans: options.relation.markerSpans.map((span) => sourceSpanForStructuralTokenSpan(options.tokens, span)),
|
|
438
|
+
separator: "space",
|
|
439
|
+
itemSeparatorTexts: payload.itemAnchors.slice(0, -1).map((_, index) => {
|
|
440
|
+
const markerEnd = options.relation.markerSpans[index]?.endExclusive ?? 0;
|
|
441
|
+
const nextItemStart = payload.itemAnchors[index + 1]?.span.start ?? markerEnd;
|
|
442
|
+
const separatorSpans = payload.separatorSpans.filter((span) => span.start >= markerEnd && span.endExclusive <= nextItemStart);
|
|
443
|
+
return separatorSpans.length === 0
|
|
444
|
+
? " "
|
|
445
|
+
: separatorSpans.map((span) => span.surface).join("");
|
|
446
|
+
}),
|
|
447
|
+
itemSeparatorSourceSpans: payload.itemAnchors.slice(0, -1).map((_, index) => {
|
|
448
|
+
const markerEnd = options.relation.markerSpans[index]?.endExclusive ?? 0;
|
|
449
|
+
const nextItemStart = payload.itemAnchors[index + 1]?.span.start ?? markerEnd;
|
|
450
|
+
const separatorSpans = payload.separatorSpans.filter((span) => span.start >= markerEnd && span.endExclusive <= nextItemStart);
|
|
451
|
+
const firstSeparator = separatorSpans[0];
|
|
452
|
+
const lastSeparator = separatorSpans.at(-1);
|
|
453
|
+
return firstSeparator === undefined || lastSeparator === undefined
|
|
454
|
+
? null
|
|
455
|
+
: sourceSpanForStructuralTokenSpan(options.tokens, {
|
|
456
|
+
start: firstSeparator.start,
|
|
457
|
+
endExclusive: lastSeparator.endExclusive,
|
|
458
|
+
});
|
|
459
|
+
}),
|
|
460
|
+
...(consumeTrailing && trailingParticle !== null && payload.trailingParticleSpan !== null
|
|
461
|
+
? {
|
|
462
|
+
trailingParticle,
|
|
463
|
+
trailingParticleSourceSpan: sourceSpanForStructuralTokenSpan(options.tokens, payload.trailingParticleSpan),
|
|
464
|
+
}
|
|
465
|
+
: {}),
|
|
466
|
+
nominalListingStyle: "toka",
|
|
467
|
+
nominalListingClosure: payload.closure,
|
|
468
|
+
koreanPos: 구,
|
|
469
|
+
},
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
function tokaNominalListingHasUnownedSourceGap(tokens, spans) {
|
|
473
|
+
const indexes = uniqueSorted(spans.flatMap((span) => {
|
|
474
|
+
const values = [];
|
|
475
|
+
for (let index = span.start; index < span.endExclusive; index += 1) {
|
|
476
|
+
values.push(index);
|
|
477
|
+
}
|
|
478
|
+
return values;
|
|
479
|
+
}));
|
|
480
|
+
for (let position = 1; position < indexes.length; position += 1) {
|
|
481
|
+
const previous = tokens[indexes[position - 1]];
|
|
482
|
+
const current = tokens[indexes[position]];
|
|
483
|
+
const previousSpan = previous?.sourceSpan;
|
|
484
|
+
const currentSpan = current?.sourceSpan;
|
|
485
|
+
if (previousSpan !== undefined &&
|
|
486
|
+
previousSpan !== null &&
|
|
487
|
+
currentSpan !== undefined &&
|
|
488
|
+
currentSpan !== null &&
|
|
489
|
+
previousSpan.endOrdinal < currentSpan.startOrdinal) {
|
|
490
|
+
return true;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
return false;
|
|
494
|
+
}
|
|
495
|
+
function tokaNominalListingRelationWithoutTrailingParticle(relation) {
|
|
496
|
+
const payload = relation.tokaNominalListing;
|
|
497
|
+
if (payload === undefined || payload.trailingParticleSpan === null) {
|
|
498
|
+
return relation;
|
|
499
|
+
}
|
|
500
|
+
const sourceEnd = Math.max(...payload.itemAnchors.map((item) => item.span.endExclusive), ...relation.markerSpans.map((span) => span.endExclusive));
|
|
501
|
+
return {
|
|
502
|
+
...relation,
|
|
503
|
+
source: {
|
|
504
|
+
...relation.source,
|
|
505
|
+
span: { ...relation.source.span, endExclusive: sourceEnd },
|
|
506
|
+
},
|
|
507
|
+
...(relation.candidateSuppressibleTokenSpans === undefined ? {} : {
|
|
508
|
+
candidateSuppressibleTokenSpans: relation.candidateSuppressibleTokenSpans.filter((span) => span.reason !== "relation_trailing_particle"),
|
|
509
|
+
}),
|
|
510
|
+
tokaNominalListing: {
|
|
511
|
+
...payload,
|
|
512
|
+
trailingParticleSpan: null,
|
|
513
|
+
},
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
function nariParallelItemPlan(tokens, units, item, itemKind) {
|
|
517
|
+
const unitIndexes = unitIndexesInSpan(units, item.source.span);
|
|
518
|
+
if (unitIndexes.length === 0) {
|
|
519
|
+
return null;
|
|
520
|
+
}
|
|
521
|
+
if (itemKind === "nominal") {
|
|
522
|
+
return composeRelationSourceUnitPlans(tokens, units, unitIndexes);
|
|
523
|
+
}
|
|
524
|
+
const predicateUnitIndex = parallelPredicateUnitIndex(units, unitIndexes, item.predicateIdx);
|
|
525
|
+
if (predicateUnitIndex === null) {
|
|
526
|
+
return null;
|
|
527
|
+
}
|
|
528
|
+
const predicateUnit = units[predicateUnitIndex];
|
|
529
|
+
if (predicateUnit === undefined) {
|
|
530
|
+
return null;
|
|
531
|
+
}
|
|
532
|
+
const projected = nariParallelPredicateProjectionPlan(predicateUnit.renderPlan);
|
|
533
|
+
if (projected === null) {
|
|
534
|
+
return null;
|
|
535
|
+
}
|
|
536
|
+
const extraUnitIndexes = unitIndexes.filter((unitIndex) => unitIndex !== predicateUnitIndex && units[unitIndex]?.unitType !== UnitType.SYMBOL);
|
|
537
|
+
if (extraUnitIndexes.length === 0) {
|
|
538
|
+
return projected;
|
|
539
|
+
}
|
|
540
|
+
if (extraUnitIndexes.some((unitIndex) => unitIndex > predicateUnitIndex)) {
|
|
541
|
+
return null;
|
|
542
|
+
}
|
|
543
|
+
return composeRelationSourceUnitPlans(tokens, units, unitIndexes, new Map([[predicateUnitIndex, projected]]));
|
|
544
|
+
}
|
|
545
|
+
function nariParallelPredicateProjectionPlan(plan) {
|
|
546
|
+
if (plan?.kind === "lemma") {
|
|
547
|
+
if ((plan.koreanPos !== 동사 && plan.koreanPos !== 형용사) ||
|
|
548
|
+
plan.prefix !== undefined ||
|
|
549
|
+
plan.suffix !== undefined ||
|
|
550
|
+
(plan.connective !== undefined && plan.connective !== null) ||
|
|
551
|
+
(plan.sfp !== undefined && plan.sfp !== null)) {
|
|
552
|
+
return null;
|
|
553
|
+
}
|
|
554
|
+
return {
|
|
555
|
+
...plan,
|
|
556
|
+
connective: "든",
|
|
557
|
+
sfp: null,
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
if (plan?.kind !== "headTailChain" || plan.realization.kind !== "predicate" || plan.realization.root.tail.kind !== "auxLayer") {
|
|
561
|
+
return null;
|
|
562
|
+
}
|
|
563
|
+
const layer = plan.realization.root.tail;
|
|
564
|
+
if (layer.ops.length !== 0 || layer.terminal !== null || plan.realization.root.sfp !== null) {
|
|
565
|
+
return null;
|
|
566
|
+
}
|
|
567
|
+
const stem = layer.stem;
|
|
568
|
+
if (stem.kind !== "verb" && stem.kind !== "adj") {
|
|
569
|
+
return null;
|
|
570
|
+
}
|
|
571
|
+
return {
|
|
572
|
+
kind: "lemma",
|
|
573
|
+
entry: plan.realization.entry ?? null,
|
|
574
|
+
koreanLemma: stem.lemma,
|
|
575
|
+
koreanPos: stem.kind === "verb" ? 동사 : 형용사,
|
|
576
|
+
irregular: stem.irregular,
|
|
577
|
+
auxTokens: [],
|
|
578
|
+
connective: "든",
|
|
579
|
+
voice: "active",
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
function nariItemSpanContainsTransparentPunctuation(tokens, span) {
|
|
583
|
+
for (let index = span.start; index < span.endExclusive; index += 1) {
|
|
584
|
+
const token = tokens[index];
|
|
585
|
+
if (token !== undefined && isClauseEvidenceTransparentPunctuation(token)) {
|
|
586
|
+
return true;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
return false;
|
|
590
|
+
}
|
|
591
|
+
function nariParallelTrailingParticleKey(units, span) {
|
|
592
|
+
if (span === null) {
|
|
593
|
+
return null;
|
|
594
|
+
}
|
|
595
|
+
for (const unitIndex of unitIndexesInSpan(units, span)) {
|
|
596
|
+
const key = units[unitIndex]?.allomorphKey;
|
|
597
|
+
if (key === undefined || key === null) {
|
|
598
|
+
continue;
|
|
599
|
+
}
|
|
600
|
+
const particle = particleKeyFromAllomorph(key);
|
|
601
|
+
if (particle !== null) {
|
|
602
|
+
return particle;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
return null;
|
|
606
|
+
}
|
|
607
|
+
function kaParallelTrailingSuffixPlan(tokens, units, sourceUnitIndexes, sourceEndExclusive, lookups, closure) {
|
|
608
|
+
const cursor = new TokenCursor(tokens, sourceEndExclusive, tokens.length, sourceEndExclusive);
|
|
609
|
+
const externalSuffix = kaParallelExternalDakeCopulaSuffixPlan(cursor, units, lookups);
|
|
610
|
+
if (externalSuffix !== null) {
|
|
611
|
+
return externalSuffix;
|
|
612
|
+
}
|
|
613
|
+
const embeddedQuestionQuote = kaParallelEmbeddedQuestionQuoteSuffix(units, closure);
|
|
614
|
+
if (embeddedQuestionQuote !== null) {
|
|
615
|
+
return embeddedQuestionQuote;
|
|
616
|
+
}
|
|
617
|
+
for (const unitIndex of sourceUnitIndexes) {
|
|
618
|
+
const unit = units[unitIndex];
|
|
619
|
+
const plan = unit?.renderPlan;
|
|
620
|
+
if (unit === undefined ||
|
|
621
|
+
plan?.kind !== "predicateScopeCarrier" ||
|
|
622
|
+
plan.suffix === undefined ||
|
|
623
|
+
!unit.jpIndices.some((jpIndex) => jpIndex >= sourceEndExclusive)) {
|
|
624
|
+
continue;
|
|
625
|
+
}
|
|
626
|
+
return { suffix: plan.suffix, suffixUnitIndexes: [unitIndex] };
|
|
627
|
+
}
|
|
628
|
+
return { suffix: null, suffixUnitIndexes: [] };
|
|
629
|
+
}
|
|
630
|
+
function kaParallelEmbeddedQuestionQuoteSuffix(units, closure) {
|
|
631
|
+
if (closure.kind !== "attributive_quote") {
|
|
632
|
+
return null;
|
|
633
|
+
}
|
|
634
|
+
const suffixUnitIndexes = unitIndexesInSpan(units, {
|
|
635
|
+
start: closure.markerSpan.start,
|
|
636
|
+
endExclusive: closure.markerSpan.endExclusive
|
|
637
|
+
});
|
|
638
|
+
return suffixUnitIndexes.length === 0
|
|
639
|
+
? null
|
|
640
|
+
: {
|
|
641
|
+
suffix: closure.realization === "light_koto"
|
|
642
|
+
? " 하는"
|
|
643
|
+
: closure.realization === "pronominal_no" ? "라는 것" : "라는",
|
|
644
|
+
suffixUnitIndexes
|
|
645
|
+
};
|
|
646
|
+
}
|
|
647
|
+
function kaParallelExternalDakeCopulaSuffixPlan(cursor, units, lookups) {
|
|
648
|
+
const { tokens, pos: sourceEndExclusive } = cursor;
|
|
649
|
+
const dakeIndex = nextNonSpaceTokenIndex(cursor);
|
|
650
|
+
const dake = dakeIndex === null ? undefined : tokens[dakeIndex];
|
|
651
|
+
if (dakeIndex === null || dake?.surface !== "だけ") {
|
|
652
|
+
return null;
|
|
653
|
+
}
|
|
654
|
+
const copulaTail = matchCopulaTailWithOptionalConditional(cursor.fork(dakeIndex + 1, cursor.end, dakeIndex + 1), { skipLeadingSpace: true });
|
|
655
|
+
if (copulaTail === null || (copulaTail.auxTokens.length === 0 && copulaTail.connective === null)) {
|
|
656
|
+
return null;
|
|
657
|
+
}
|
|
658
|
+
let endExclusive = dakeIndex + 1 + copulaTail.consumed;
|
|
659
|
+
let connective = copulaTail.connective;
|
|
660
|
+
const tameReasonConsumed = kaParallelTameReasonTail(cursor.fork(endExclusive), sourceEndExclusive - 1, lookups);
|
|
661
|
+
if (tameReasonConsumed !== null) {
|
|
662
|
+
connective = "기 때문에";
|
|
663
|
+
endExclusive += tameReasonConsumed;
|
|
664
|
+
}
|
|
665
|
+
else if (!kaParallelSuffixCanEndAt(cursor.fork(endExclusive))) {
|
|
666
|
+
return null;
|
|
667
|
+
}
|
|
668
|
+
const suffixUnitIndexes = unitIndexesInSpan(units, {
|
|
669
|
+
start: dakeIndex,
|
|
670
|
+
endExclusive,
|
|
671
|
+
});
|
|
672
|
+
if (suffixUnitIndexes.length === 0) {
|
|
673
|
+
return null;
|
|
674
|
+
}
|
|
675
|
+
return {
|
|
676
|
+
suffix: {
|
|
677
|
+
kind: "lemma",
|
|
678
|
+
entry: null,
|
|
679
|
+
koreanLemma: "뿐",
|
|
680
|
+
koreanPos: 명사,
|
|
681
|
+
irregular: null,
|
|
682
|
+
auxTokens: copulaTail.auxTokens,
|
|
683
|
+
formalOverride: true,
|
|
684
|
+
...(connective === null ? {} : { connective }),
|
|
685
|
+
},
|
|
686
|
+
suffixUnitIndexes,
|
|
687
|
+
};
|
|
688
|
+
}
|
|
689
|
+
function kaParallelTameReasonTail(cursor, contentIdx, lookups) {
|
|
690
|
+
const headIndex = nextNonSpaceTokenIndex(cursor);
|
|
691
|
+
const headToken = headIndex === null ? null : cursor.tokens[headIndex] ?? null;
|
|
692
|
+
if (!isTameReasonHeadContext(headToken, cursor.tokens, contentIdx, lookups)) {
|
|
693
|
+
return null;
|
|
694
|
+
}
|
|
695
|
+
if (headIndex === null) {
|
|
696
|
+
return null;
|
|
697
|
+
}
|
|
698
|
+
return headIndex - cursor.pos + 1;
|
|
699
|
+
}
|
|
700
|
+
function kaParallelSuffixCanEndAt(cursor) {
|
|
701
|
+
const index = nextNonSpaceTokenIndex(cursor);
|
|
702
|
+
if (index === null) {
|
|
703
|
+
return true;
|
|
704
|
+
}
|
|
705
|
+
const token = cursor.tokens[index];
|
|
706
|
+
if (token === undefined) {
|
|
707
|
+
return false;
|
|
708
|
+
}
|
|
709
|
+
const pos0 = token.pos & POS0;
|
|
710
|
+
return pos0 === 補助記号 || pos0 === 記号;
|
|
711
|
+
}
|
|
712
|
+
function nextNonSpaceTokenIndex(cursor) {
|
|
713
|
+
const c = cursor.fork();
|
|
714
|
+
return c.pos < c.end ? c.pos : null;
|
|
715
|
+
}
|
|
716
|
+
function kaParallelItemPlan(tokens, units, item, relationKind, isLast, closure, matrixQuestionItems) {
|
|
717
|
+
const unitIndexes = unitIndexesInSpan(units, item.source.span);
|
|
718
|
+
if (unitIndexes.length === 0) {
|
|
719
|
+
return null;
|
|
720
|
+
}
|
|
721
|
+
if (relationKind === "toka_parallel_listing") {
|
|
722
|
+
return tokaParallelListingItemPlan(tokens, units, unitIndexes, item);
|
|
723
|
+
}
|
|
724
|
+
if (relationKind === "ka_parallel_choice") {
|
|
725
|
+
const replacements = new Map();
|
|
726
|
+
for (const unitIndex of unitIndexes) {
|
|
727
|
+
const unit = units[unitIndex];
|
|
728
|
+
if (unit === undefined) {
|
|
729
|
+
continue;
|
|
730
|
+
}
|
|
731
|
+
const projected = projectUnitWithoutKaSfpPlan(unit, item.markerSpan, tokens);
|
|
732
|
+
if (projected !== null) {
|
|
733
|
+
replacements.set(unitIndex, projected);
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
return composeRelationSourceUnitPlans(tokens, units, unitIndexes, replacements);
|
|
737
|
+
}
|
|
738
|
+
const negativeAlternative = kaParallelNegativeAlternativePlan(item);
|
|
739
|
+
if (negativeAlternative !== null) {
|
|
740
|
+
return negativeAlternative;
|
|
741
|
+
}
|
|
742
|
+
const predicateUnitIndex = parallelPredicateUnitIndex(units, unitIndexes, item.predicateIdx);
|
|
743
|
+
if (predicateUnitIndex === null) {
|
|
744
|
+
if (!matrixQuestionItems) {
|
|
745
|
+
return composeRelationSourceUnitPlans(tokens, units, unitIndexes);
|
|
746
|
+
}
|
|
747
|
+
const replacements = new Map();
|
|
748
|
+
for (const unitIndex of unitIndexes) {
|
|
749
|
+
const plan = units[unitIndex]?.renderPlan;
|
|
750
|
+
if (plan === undefined || plan === null)
|
|
751
|
+
continue;
|
|
752
|
+
const projected = markQuestionContentTerminalPlan(plan);
|
|
753
|
+
if (projected !== plan)
|
|
754
|
+
replacements.set(unitIndex, projected);
|
|
755
|
+
}
|
|
756
|
+
return composeRelationSourceUnitPlans(tokens, units, unitIndexes, replacements);
|
|
757
|
+
}
|
|
758
|
+
const predicateUnit = units[predicateUnitIndex];
|
|
759
|
+
if (predicateUnit === undefined) {
|
|
760
|
+
return null;
|
|
761
|
+
}
|
|
762
|
+
if (isLast && closure.kind === "terminal_fragment" && isNominalizedConjectureMatrixQuestionPlan(predicateUnit.renderPlan)) {
|
|
763
|
+
return composeRelationSourceUnitPlans(tokens, units, unitIndexes);
|
|
764
|
+
}
|
|
765
|
+
const projectedPredicateBase = projectSimpleNegativeHeadTailQuestionContentPlan(predicateUnit.renderPlan) ??
|
|
766
|
+
projectUnitHeadTailConnectivePlan(predicateUnit, { connective: "question_content", surface: item.markerSpan.surface }, opSourceForMarkerSpans(tokens, [item.markerSpan]), true, closure.kind === "attributive_quote"
|
|
767
|
+
? opSourceForMarkerSpans(tokens, [item.markerSpan, closure.markerSpan])
|
|
768
|
+
: null) ??
|
|
769
|
+
projectLemmaQuestionContentPlan(predicateUnit.renderPlan) ??
|
|
770
|
+
projectConjugatedLemmaQuestionContentPlan(predicateUnit.renderPlan) ??
|
|
771
|
+
projectPredicateScopeCarrierQuestionContentPlan(predicateUnit.renderPlan);
|
|
772
|
+
if (projectedPredicateBase === null) {
|
|
773
|
+
return null;
|
|
774
|
+
}
|
|
775
|
+
const projectedPredicate = matrixQuestionItems
|
|
776
|
+
? markQuestionContentTerminalPlan(projectedPredicateBase)
|
|
777
|
+
: markStructuralKaParallelQuestionContentPlan(projectedPredicateBase);
|
|
778
|
+
return composeRelationSourceUnitPlans(tokens, units, unitIndexes, new Map([[predicateUnitIndex, projectedPredicate]]));
|
|
779
|
+
}
|
|
780
|
+
function tokaParallelListingItemPlan(tokens, units, unitIndexes, item) {
|
|
781
|
+
const replacements = new Map();
|
|
782
|
+
const ownerUnitIndex = parallelPredicateUnitIndex(units, unitIndexes, item.predicateIdx);
|
|
783
|
+
const plan = ownerUnitIndex === null ? null : units[ownerUnitIndex]?.renderPlan ?? null;
|
|
784
|
+
if (ownerUnitIndex !== null && plan !== null) {
|
|
785
|
+
const copulaIdx = previousNonSpaceTokenIndex(tokens, item.markerSpan.start);
|
|
786
|
+
const copula = copulaIdx === null ? undefined : tokens[copulaIdx];
|
|
787
|
+
const basePlan = plan.kind === "lemma"
|
|
788
|
+
? {
|
|
789
|
+
...plan,
|
|
790
|
+
auxTokens: copula === undefined
|
|
791
|
+
? plan.auxTokens
|
|
792
|
+
: plan.auxTokens.filter((token) => !sourceTokensOverlap(token, copula)),
|
|
793
|
+
sfp: null,
|
|
794
|
+
terminalSfp: null,
|
|
795
|
+
}
|
|
796
|
+
: plan;
|
|
797
|
+
const exemplified = item.predicateCategory === "predicate"
|
|
798
|
+
? projectTokaPredicateListingPlan(basePlan, opSourceForMarkerSpans(tokens, [item.markerSpan]))
|
|
799
|
+
: attachParticleRenderPlan(basePlan, "이라든가/라든가");
|
|
800
|
+
if (exemplified === null) {
|
|
801
|
+
return null;
|
|
802
|
+
}
|
|
803
|
+
replacements.set(ownerUnitIndex, exemplified);
|
|
804
|
+
}
|
|
805
|
+
return composeRelationSourceUnitPlans(tokens, units, unitIndexes, replacements);
|
|
806
|
+
}
|
|
807
|
+
function projectTokaPredicateListingPlan(plan, source) {
|
|
808
|
+
if (plan.kind === "lemma") {
|
|
809
|
+
const rule = CONNECTIVE_RENDER_MAP.get("とか");
|
|
810
|
+
if (rule === undefined || (plan.koreanPos !== 동사 && plan.koreanPos !== 형용사)) {
|
|
811
|
+
return null;
|
|
812
|
+
}
|
|
813
|
+
return {
|
|
814
|
+
...plan,
|
|
815
|
+
connective: plan.koreanPos === 형용사 ? rule.adjEnding ?? rule.korean : rule.korean,
|
|
816
|
+
...(rule.suffixText === undefined ? {} : { suffix: `${plan.suffix ?? ""}${rule.suffixText}` }),
|
|
817
|
+
sfp: null,
|
|
818
|
+
terminalSfp: null,
|
|
819
|
+
};
|
|
820
|
+
}
|
|
821
|
+
if (!isPredicateHeadTailChainRenderPlan(plan) || source === null) {
|
|
822
|
+
return null;
|
|
823
|
+
}
|
|
824
|
+
return projectHeadTailConnectivePlan(plan, { connective: "exemplification", surface: "とか" }, source);
|
|
825
|
+
}
|
|
826
|
+
function markQuestionContentTerminalPlan(plan) {
|
|
827
|
+
if (!isPredicateHeadTailChainRenderPlan(plan) || plan.realization.root.tail.kind !== "auxLayer") {
|
|
828
|
+
return plan;
|
|
829
|
+
}
|
|
830
|
+
const layer = plan.realization.root.tail;
|
|
831
|
+
const ops = layer.ops.map((op) => op.kind === "connective" && op.connective === "question_content"
|
|
832
|
+
? markQuestionContentTerminalOp(op)
|
|
833
|
+
: op);
|
|
834
|
+
if (ops.every((op, index) => op === layer.ops[index]))
|
|
835
|
+
return plan;
|
|
836
|
+
return {
|
|
837
|
+
...plan,
|
|
838
|
+
realization: {
|
|
839
|
+
...plan.realization,
|
|
840
|
+
root: {
|
|
841
|
+
...plan.realization.root,
|
|
842
|
+
tail: { ...layer, ops }
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
function markStructuralKaParallelQuestionContentPlan(plan) {
|
|
848
|
+
if (!isPredicateHeadTailChainRenderPlan(plan) || plan.realization.root.tail.kind !== "auxLayer") {
|
|
849
|
+
return plan;
|
|
850
|
+
}
|
|
851
|
+
const layer = plan.realization.root.tail;
|
|
852
|
+
const ops = layer.ops.map((op) => op.kind === "connective" && op.connective === "question_content"
|
|
853
|
+
? markStructuralKaParallelQuestionContentOp(op)
|
|
854
|
+
: op);
|
|
855
|
+
return {
|
|
856
|
+
...plan,
|
|
857
|
+
realization: {
|
|
858
|
+
...plan.realization,
|
|
859
|
+
root: {
|
|
860
|
+
...plan.realization.root,
|
|
861
|
+
tail: { ...layer, ops }
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
export function markQuestionContentTerminalOp(op) {
|
|
867
|
+
return { ...op, questionContentRole: "terminal" };
|
|
868
|
+
}
|
|
869
|
+
export function markStructuralKaParallelQuestionContentOp(op) {
|
|
870
|
+
return {
|
|
871
|
+
...op,
|
|
872
|
+
questionContentRole: op.questionContentRole ?? "embedded",
|
|
873
|
+
ownedByStructuralKaParallel: true
|
|
874
|
+
};
|
|
875
|
+
}
|
|
876
|
+
function kaParallelNegativeAlternativePlan(item) {
|
|
877
|
+
if (item.itemKind !== "negative_alternative") {
|
|
878
|
+
return null;
|
|
879
|
+
}
|
|
880
|
+
return {
|
|
881
|
+
kind: "kaParallelNegativeAlternative",
|
|
882
|
+
koreanPos: 구,
|
|
883
|
+
};
|
|
884
|
+
}
|
|
885
|
+
function projectUnitWithoutKaSfpPlan(unit, markerSpan, tokens) {
|
|
886
|
+
const plan = unit.renderPlan;
|
|
887
|
+
if (!isPredicateHeadTailChainRenderPlan(plan)) {
|
|
888
|
+
return null;
|
|
889
|
+
}
|
|
890
|
+
const sfp = plan.realization.root.sfp;
|
|
891
|
+
const markerSource = opSourceForMarkerSpans(tokens, [{
|
|
892
|
+
start: markerSpan.start,
|
|
893
|
+
endExclusive: markerSpan.endExclusive,
|
|
894
|
+
surface: "",
|
|
895
|
+
role: "ka_parallel_marker",
|
|
896
|
+
}]);
|
|
897
|
+
if (markerSource === null || sfp?.effect !== "ka" || !opSourceCoveredBy(sfp.source, markerSource)) {
|
|
898
|
+
return null;
|
|
899
|
+
}
|
|
900
|
+
const projectedRoot = {
|
|
901
|
+
...plan.realization.root,
|
|
902
|
+
sfp: null,
|
|
903
|
+
};
|
|
904
|
+
const { headTailCandidate: _headTailCandidate, headTailSourceCandidate: _headTailSourceCandidate, ...planWithoutOriginalSourceCandidate } = plan;
|
|
905
|
+
return {
|
|
906
|
+
...planWithoutOriginalSourceCandidate,
|
|
907
|
+
realization: { ...plan.realization, root: projectedRoot },
|
|
908
|
+
clauseRole: { ...plan.clauseRole, outgoingBoundary: { kind: "terminal" } },
|
|
909
|
+
};
|
|
910
|
+
}
|
|
911
|
+
function lastRealizedUnitIndexAfter(units, unitIndexes, anchorPos) {
|
|
912
|
+
for (let index = unitIndexes.length - 1; index >= anchorPos; index -= 1) {
|
|
913
|
+
const unitIndex = unitIndexes[index];
|
|
914
|
+
if (unitIndex === undefined) {
|
|
915
|
+
continue;
|
|
916
|
+
}
|
|
917
|
+
const unit = units[unitIndex];
|
|
918
|
+
if (unit !== undefined && unit.unitType !== UnitType.SYMBOL && unit.renderPlan !== null) {
|
|
919
|
+
return unitIndex;
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
return null;
|
|
923
|
+
}
|
|
924
|
+
function isNominalHeadUnit(unit) {
|
|
925
|
+
const pos0 = (unit?.jpHead.pos ?? 0) & POS0;
|
|
926
|
+
return pos0 === 名詞 || pos0 === 代名詞;
|
|
927
|
+
}
|
|
928
|
+
function parallelPredicateUnitIndex(units, unitIndexes, predicateIdx) {
|
|
929
|
+
if (predicateIdx !== null) {
|
|
930
|
+
const anchorPos = unitIndexes.findIndex((unitIndex) => units[unitIndex]?.jpIndices.includes(predicateIdx) === true);
|
|
931
|
+
if (anchorPos >= 0) {
|
|
932
|
+
const closingUnitIndex = lastRealizedUnitIndexAfter(units, unitIndexes, anchorPos);
|
|
933
|
+
if (closingUnitIndex !== null && isNominalHeadUnit(units[closingUnitIndex])) {
|
|
934
|
+
return closingUnitIndex;
|
|
935
|
+
}
|
|
936
|
+
const anchorUnitIndex = unitIndexes[anchorPos];
|
|
937
|
+
if (anchorUnitIndex !== undefined) {
|
|
938
|
+
return anchorUnitIndex;
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
for (let index = unitIndexes.length - 1; index >= 0; index -= 1) {
|
|
943
|
+
const unitIndex = unitIndexes[index];
|
|
944
|
+
if (unitIndex === undefined) {
|
|
945
|
+
continue;
|
|
946
|
+
}
|
|
947
|
+
const unit = units[unitIndex];
|
|
948
|
+
if (unit !== undefined && unit.unitType !== UnitType.SYMBOL && unit.renderPlan !== null) {
|
|
949
|
+
return unitIndex;
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
return null;
|
|
953
|
+
}
|
|
954
|
+
function projectLemmaQuestionContentPlan(plan) {
|
|
955
|
+
if (plan?.kind !== "lemma") {
|
|
956
|
+
return null;
|
|
957
|
+
}
|
|
958
|
+
if (plan.koreanPos !== 동사 && plan.koreanPos !== 형용사 && plan.koreanPos !== 명사 && plan.koreanPos !== 대명사) {
|
|
959
|
+
return null;
|
|
960
|
+
}
|
|
961
|
+
return {
|
|
962
|
+
...plan,
|
|
963
|
+
connective: "는지",
|
|
964
|
+
sfp: null,
|
|
965
|
+
};
|
|
966
|
+
}
|
|
967
|
+
function projectConjugatedLemmaQuestionContentPlan(plan) {
|
|
968
|
+
if (plan?.kind !== "conjugatedLemma") {
|
|
969
|
+
return null;
|
|
970
|
+
}
|
|
971
|
+
if (!("koreanLemma" in plan) || !("ending" in plan) || plan.koreanPos !== 동사 && plan.koreanPos !== 형용사) {
|
|
972
|
+
return null;
|
|
973
|
+
}
|
|
974
|
+
return {
|
|
975
|
+
...plan,
|
|
976
|
+
ending: plan.koreanPos === 형용사 ? "ㄴ/은지" : "는지",
|
|
977
|
+
};
|
|
978
|
+
}
|
|
979
|
+
function projectPredicateScopeCarrierQuestionContentPlan(plan) {
|
|
980
|
+
if (plan?.kind !== "predicateScopeCarrier") {
|
|
981
|
+
return null;
|
|
982
|
+
}
|
|
983
|
+
if (plan.projection.kind === "direct" && predicateHeadTailPlanHasQuestionContent(plan.projection.base)) {
|
|
984
|
+
return projectSimpleNegativeHeadTailQuestionContentPlan(plan.projection.base) ?? plan.projection.base;
|
|
985
|
+
}
|
|
986
|
+
return projectLemmaQuestionContentPlan(plan.projection.base);
|
|
987
|
+
}
|
|
988
|
+
function predicateHeadTailPlanHasQuestionContent(plan) {
|
|
989
|
+
if (plan === null) {
|
|
990
|
+
return false;
|
|
991
|
+
}
|
|
992
|
+
if (plan.kind !== "headTailChain" || plan.realization.kind !== "predicate" || plan.realization.root.tail.kind !== "auxLayer") {
|
|
993
|
+
return false;
|
|
994
|
+
}
|
|
995
|
+
return plan.realization.root.tail.ops.some((op) => (op.kind === "connective" &&
|
|
996
|
+
(op.connective === "question_content" || op.connective === "question_content_alternative")));
|
|
997
|
+
}
|
|
998
|
+
function projectSimpleNegativeHeadTailQuestionContentPlan(plan) {
|
|
999
|
+
if (!predicateHeadTailPlanHasQuestionContent(plan)) {
|
|
1000
|
+
return null;
|
|
1001
|
+
}
|
|
1002
|
+
if (plan.realization.root.tail.kind !== "auxLayer" || plan.realization.root.tail.terminal !== null || plan.realization.root.sfp !== null) {
|
|
1003
|
+
return null;
|
|
1004
|
+
}
|
|
1005
|
+
const layer = plan.realization.root.tail;
|
|
1006
|
+
if (layer.ops.length !== 2) {
|
|
1007
|
+
return null;
|
|
1008
|
+
}
|
|
1009
|
+
const [negative, connective] = layer.ops;
|
|
1010
|
+
if (negative?.kind !== "negation" ||
|
|
1011
|
+
connective?.kind !== "connective" ||
|
|
1012
|
+
(connective.connective !== "question_content" && connective.connective !== "question_content_alternative")) {
|
|
1013
|
+
return null;
|
|
1014
|
+
}
|
|
1015
|
+
const stem = committedPredicateStemView(layer.stem);
|
|
1016
|
+
if (stem === null) {
|
|
1017
|
+
return null;
|
|
1018
|
+
}
|
|
1019
|
+
if (stem.category === "adjectival_predicate") {
|
|
1020
|
+
return {
|
|
1021
|
+
kind: "lemma",
|
|
1022
|
+
entry: plan.realization.entry ?? null,
|
|
1023
|
+
koreanLemma: "않다",
|
|
1024
|
+
koreanPos: 형용사,
|
|
1025
|
+
irregular: null,
|
|
1026
|
+
prefix: `${conjugate(stem.lemma, asIrregular(stem.irregular), "지")} `,
|
|
1027
|
+
auxTokens: [],
|
|
1028
|
+
connective: "ㄴ/은지",
|
|
1029
|
+
voice: "active",
|
|
1030
|
+
};
|
|
1031
|
+
}
|
|
1032
|
+
return {
|
|
1033
|
+
kind: "lemma",
|
|
1034
|
+
entry: plan.realization.entry ?? null,
|
|
1035
|
+
koreanLemma: stem.lemma,
|
|
1036
|
+
koreanPos: 동사,
|
|
1037
|
+
irregular: stem.irregular,
|
|
1038
|
+
auxTokens: negative.source.tokens,
|
|
1039
|
+
connective: "는지",
|
|
1040
|
+
voice: "active",
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
function committedPredicateStemView(stem) {
|
|
1044
|
+
if (stem.kind === "verb") {
|
|
1045
|
+
return { category: "verbal_predicate", lemma: stem.lemma, irregular: stem.irregular };
|
|
1046
|
+
}
|
|
1047
|
+
if (stem.kind === "adj") {
|
|
1048
|
+
return { category: "adjectival_predicate", lemma: stem.lemma, irregular: stem.irregular };
|
|
1049
|
+
}
|
|
1050
|
+
if (stem.kind !== "candidateSet" ||
|
|
1051
|
+
stem.committedSense === undefined) {
|
|
1052
|
+
return null;
|
|
1053
|
+
}
|
|
1054
|
+
const category = committedCandidateSetPredicateCategory(stem);
|
|
1055
|
+
if (category === null) {
|
|
1056
|
+
return null;
|
|
1057
|
+
}
|
|
1058
|
+
const candidate = stem.candidates.find((item) => stemCandidateIdentitiesEqual(stemCandidateIdentity(item), stem.committedSense));
|
|
1059
|
+
return candidate === undefined
|
|
1060
|
+
? null
|
|
1061
|
+
: {
|
|
1062
|
+
category,
|
|
1063
|
+
lemma: candidate.lemma,
|
|
1064
|
+
irregular: candidate.irregular
|
|
1065
|
+
};
|
|
1066
|
+
}
|
|
1067
|
+
function committedCandidateSetPredicateCategory(stem) {
|
|
1068
|
+
const category = stem.committedSenseRealization?.category;
|
|
1069
|
+
if (category !== undefined) {
|
|
1070
|
+
return category === "verbal_predicate" || category === "adjectival_predicate"
|
|
1071
|
+
? category
|
|
1072
|
+
: null;
|
|
1073
|
+
}
|
|
1074
|
+
switch (stem.sourcePredicateShape) {
|
|
1075
|
+
case "verb":
|
|
1076
|
+
case "sahen_verbalization":
|
|
1077
|
+
return "verbal_predicate";
|
|
1078
|
+
case "i_adjective":
|
|
1079
|
+
case "na_adjective":
|
|
1080
|
+
return "adjectival_predicate";
|
|
1081
|
+
case "nominal":
|
|
1082
|
+
case "particle_phrase":
|
|
1083
|
+
case "lexical_adverb":
|
|
1084
|
+
case undefined:
|
|
1085
|
+
return null;
|
|
1086
|
+
}
|
|
1087
|
+
return null;
|
|
1088
|
+
}
|