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,968 @@
|
|
|
1
|
+
import { isPredicateHeadTailChainRenderPlan } from "../../types/render-plan.js";
|
|
2
|
+
import { previousNonSpaceIndex } from "../clause-layout/trivia.js";
|
|
3
|
+
import { attachParticleRenderPlan } from "../rendering/particle-plan.js";
|
|
4
|
+
import { resolveCandidateSetLayer } from "../head-tail/tail/predicate-root/commit.js";
|
|
5
|
+
import { normalizeProductionMatch, probeProductionDispatch } from "../head-tail/tail/predicate-root/production-registry.js";
|
|
6
|
+
import { isConditionalQuoteProductionMatch } from "../head-tail/tail/predicate-root/production-families/mid-chain-quote.js";
|
|
7
|
+
import { SFP_NA_EXCLAMATORY_NOMINALIZERS, TYPIFICATION_QUOTATIVE_HEADS } from "../head-tail/data/semantic-helper-sets.js";
|
|
8
|
+
import { quoteProjectionForSfpEffect } from "../semantics/sfp-quote-projection.js";
|
|
9
|
+
import { firstAuxLayer, isBenefactiveAspectOp, tailRootVoiceOps } from "../head-tail/tail/predicate-root/inspect.js";
|
|
10
|
+
import { tailRootHostLayerGovernsCopulaNiComplement } from "../head-tail/tail/predicate-root/postverb-host-attachment.js";
|
|
11
|
+
import { tailPredicateHostPrefersTameReason } from "../head-tail/tail/predicate-root/tame-reason-evidence.js";
|
|
12
|
+
import { attributiveModifierPlanSourceFacts } from "../rendering/render-plan-inspect.js";
|
|
13
|
+
import { UnitType } from "../translation/unit.js";
|
|
14
|
+
import { isTerminalAssertiveCopulaToken, 대명사, 동사, 명사, 형용사, 구 } from "../../types/pos.js";
|
|
15
|
+
import { createConnectiveOp, createIdiomOp } from "../head-tail/tail/predicate-root/op-builders.js";
|
|
16
|
+
import { IU_LEXEME_FORMS } from "../head-tail/data/quoted-reporting-sets.js";
|
|
17
|
+
import { sourceUnitIndexesWithToken, previousNonSpaceTokenIndex, sourceSpanForStructuralTokenSpan, unitIndexesInSpan, uniqueSorted, opSourceForMarkerSpans } from "./render-unit-spans.js";
|
|
18
|
+
import { projectPredicateHeadTailAttributivePlan } from "./render-attributive.js";
|
|
19
|
+
import { composeRelationSourceUnitPlans, structuralRelationSequencePlan } from "./render-source-sequence.js";
|
|
20
|
+
import { projectHeadTailConnectivePlan, resolvedStructuralProjectionWarnings, projectUnitPredicateConnectivePlan, opSourceCoveredBy, connectiveBoundaryForProjection } from "./render-connective-plan.js";
|
|
21
|
+
export function buildConjectureQuoteStructuredRenderOperation(options) {
|
|
22
|
+
const quote = options.relation.quote;
|
|
23
|
+
if (quote === undefined || quote.slotKind !== "quoted_content")
|
|
24
|
+
return null;
|
|
25
|
+
const sourceUnitIndex = [...options.sourceUnitIndexes].reverse().find((unitIndex) => isPredicateHeadTailChainRenderPlan(options.units[unitIndex]?.renderPlan));
|
|
26
|
+
if (sourceUnitIndex === undefined)
|
|
27
|
+
return null;
|
|
28
|
+
const unit = options.units[sourceUnitIndex];
|
|
29
|
+
const sourcePlan = unit?.renderPlan;
|
|
30
|
+
if (unit === undefined || !isPredicateHeadTailChainRenderPlan(sourcePlan))
|
|
31
|
+
return null;
|
|
32
|
+
const committed = materializeSfpOwnerStem(sourcePlan);
|
|
33
|
+
const layer = firstAuxLayer(committed.realization.root.tail);
|
|
34
|
+
if (layer === null)
|
|
35
|
+
return null;
|
|
36
|
+
const quoteIdx = layer.ops.findIndex((op) => op.kind === "connective" && op.connective === "quotative");
|
|
37
|
+
if (quoteIdx < 0)
|
|
38
|
+
return null;
|
|
39
|
+
const beforeQuote = layer.ops.slice(0, quoteIdx);
|
|
40
|
+
const conjectural = layer.stem.kind === "noun"
|
|
41
|
+
? beforeQuote.some((op) => op.kind === "copula" && op.variant === "conjecture")
|
|
42
|
+
: (layer.stem.kind === "verb" || layer.stem.kind === "adj") &&
|
|
43
|
+
beforeQuote.some((op) => op.kind === "conjecture");
|
|
44
|
+
if (!conjectural)
|
|
45
|
+
return null;
|
|
46
|
+
const suppressUnitIndexes = options.markerUnitIndexes.filter((unitIndex) => unitIndex !== sourceUnitIndex);
|
|
47
|
+
return {
|
|
48
|
+
relation: options.relation,
|
|
49
|
+
insertBeforeUnitIndex: sourceUnitIndex,
|
|
50
|
+
replaceUnitIndex: sourceUnitIndex,
|
|
51
|
+
suppressUnitIndexes,
|
|
52
|
+
sourceUnitIndexes: options.sourceUnitIndexes,
|
|
53
|
+
targetUnitIndexes: options.targetUnitIndexes,
|
|
54
|
+
projectionTokenIndexes: uniqueSorted([
|
|
55
|
+
...unit.jpIndices,
|
|
56
|
+
...suppressUnitIndexes.flatMap((unitIndex) => options.units[unitIndex]?.jpIndices ?? []),
|
|
57
|
+
]),
|
|
58
|
+
renderPlan: {
|
|
59
|
+
kind: "conjectureThoughtQuote",
|
|
60
|
+
root: committed.realization.root,
|
|
61
|
+
...(committed.realization.hostProjection === undefined
|
|
62
|
+
? {}
|
|
63
|
+
: { hostProjection: committed.realization.hostProjection }),
|
|
64
|
+
koreanPos: 구
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export function buildAttributiveTypificationQuoteStructuredRenderOperation(options) {
|
|
69
|
+
const quote = options.relation.quote;
|
|
70
|
+
if (quote === undefined || !IU_LEXEME_FORMS.has(quote.hostMatch.hostForm)) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
const hostUnitIndex = options.units.findIndex((unit) => {
|
|
74
|
+
if (!unit.jpIndices.includes(quote.hostMatch.hostIdx))
|
|
75
|
+
return false;
|
|
76
|
+
const facts = attributiveModifierPlanSourceFacts(unit.renderPlan);
|
|
77
|
+
return facts !== null && facts.sourcePast &&
|
|
78
|
+
TYPIFICATION_QUOTATIVE_HEADS.has(facts.headDictionaryForm ?? "");
|
|
79
|
+
});
|
|
80
|
+
if (hostUnitIndex < 0)
|
|
81
|
+
return null;
|
|
82
|
+
const predicateUnitIndex = [...options.sourceUnitIndexes].reverse().find((unitIndex) => isPredicateHeadTailChainRenderPlan(options.units[unitIndex]?.renderPlan)) ?? null;
|
|
83
|
+
const predicateUnit = predicateUnitIndex === null ? undefined : options.units[predicateUnitIndex];
|
|
84
|
+
if (predicateUnitIndex === null || predicateUnit === undefined)
|
|
85
|
+
return null;
|
|
86
|
+
const unquoted = projectUnitWithoutQuoteMarkerConnectivePlan(predicateUnit, opSourceForMarkerSpans(options.tokens, options.relation.markerSpans));
|
|
87
|
+
const attributive = unquoted === null ? null : projectPredicateHeadTailAttributivePlan(unquoted);
|
|
88
|
+
if (attributive === null)
|
|
89
|
+
return null;
|
|
90
|
+
const sourcePlan = composeRelationSourceUnitPlans(options.tokens, options.units, options.sourceUnitIndexes, new Map([[predicateUnitIndex, attributive]]));
|
|
91
|
+
if (sourcePlan === null)
|
|
92
|
+
return null;
|
|
93
|
+
const renderPlan = structuralRelationSequencePlan([
|
|
94
|
+
sourcePlan,
|
|
95
|
+
{ kind: "structuralText", text: " 등의", koreanPos: 구 },
|
|
96
|
+
]);
|
|
97
|
+
if (renderPlan === null)
|
|
98
|
+
return null;
|
|
99
|
+
const suppressUnitIndexes = uniqueSorted([
|
|
100
|
+
...options.sourceUnitIndexes,
|
|
101
|
+
...options.markerUnitIndexes,
|
|
102
|
+
hostUnitIndex,
|
|
103
|
+
]).filter((unitIndex) => options.units[unitIndex]?.unitType !== UnitType.SYMBOL);
|
|
104
|
+
return {
|
|
105
|
+
relation: options.relation,
|
|
106
|
+
insertBeforeUnitIndex: options.sourceUnitIndexes[0] ?? predicateUnitIndex,
|
|
107
|
+
suppressUnitIndexes,
|
|
108
|
+
sourceUnitIndexes: options.sourceUnitIndexes,
|
|
109
|
+
targetUnitIndexes: options.targetUnitIndexes,
|
|
110
|
+
projectionTokenIndexes: uniqueSorted(suppressUnitIndexes.flatMap((unitIndex) => options.units[unitIndex]?.jpIndices ?? [])),
|
|
111
|
+
renderPlan,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
export function buildMarkerAbsorbedContentCopulaRenderOperation(options) {
|
|
115
|
+
const quote = options.relation.quote;
|
|
116
|
+
const copulaIdx = quote?.markerAbsorbedContentCopulaIdx;
|
|
117
|
+
const contentPredicateIdx = quote?.contentPredicateIdx;
|
|
118
|
+
if (quote === undefined ||
|
|
119
|
+
copulaIdx === undefined ||
|
|
120
|
+
contentPredicateIdx === undefined ||
|
|
121
|
+
contentPredicateIdx === null ||
|
|
122
|
+
quote.terminalSfp !== undefined && quote.terminalSfp !== null) {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
const sourceUnitIndex = options.sourceUnitIndexes.find((unitIndex) => options.units[unitIndex]?.jpIndices.includes(contentPredicateIdx) === true);
|
|
126
|
+
const sourceUnit = sourceUnitIndex === undefined ? undefined : options.units[sourceUnitIndex];
|
|
127
|
+
const plan = sourceUnit?.renderPlan;
|
|
128
|
+
const absorbedAux = plan?.kind === "lemma" ? plan.auxTokens[0] : undefined;
|
|
129
|
+
if (sourceUnitIndex === undefined ||
|
|
130
|
+
sourceUnit === undefined ||
|
|
131
|
+
plan?.kind !== "lemma" ||
|
|
132
|
+
(plan.koreanPos !== 명사 && plan.koreanPos !== 대명사) ||
|
|
133
|
+
(plan.terminalSfp !== undefined && plan.terminalSfp !== null) ||
|
|
134
|
+
plan.auxTokens.length !== 1 ||
|
|
135
|
+
absorbedAux === undefined ||
|
|
136
|
+
!sourceUnit.jpIndices.includes(copulaIdx) ||
|
|
137
|
+
absorbedAux.surface !== "だ" ||
|
|
138
|
+
!isTerminalAssertiveCopulaToken(absorbedAux)) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
const quotativeMarkerUnitIndex = options.markerUnitIndexes.find((unitIndex) => unitIndex !== sourceUnitIndex &&
|
|
142
|
+
options.units[unitIndex]?.unitType === UnitType.FUNCTIONAL);
|
|
143
|
+
return {
|
|
144
|
+
relation: options.relation,
|
|
145
|
+
insertBeforeUnitIndex: sourceUnitIndex,
|
|
146
|
+
replaceUnitIndex: sourceUnitIndex,
|
|
147
|
+
suppressUnitIndexes: [],
|
|
148
|
+
sourceUnitIndexes: options.sourceUnitIndexes,
|
|
149
|
+
targetUnitIndexes: options.targetUnitIndexes,
|
|
150
|
+
projectionTokenIndexes: uniqueSorted(sourceUnit.jpIndices),
|
|
151
|
+
renderPlan: { ...plan, auxTokens: [] },
|
|
152
|
+
...(quotativeMarkerUnitIndex === undefined ? {} : { quotativeMarkerUnitIndex }),
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
export function buildSfpQuoteStructuredRenderOperation(options) {
|
|
156
|
+
const quote = options.relation.quote;
|
|
157
|
+
if (quote === undefined ||
|
|
158
|
+
(quote.slotKind !== "quoted_content" && quote.slotKind !== "question_content" && quote.slotKind !== "request_content") ||
|
|
159
|
+
quote.terminalSfp === undefined ||
|
|
160
|
+
quote.terminalSfp === null) {
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
const sourceUnitIndex = quote.contentPredicateIdx === undefined || quote.contentPredicateIdx === null
|
|
164
|
+
? null
|
|
165
|
+
: options.sourceUnitIndexes.find((unitIndex) => options.units[unitIndex]?.jpIndices.includes(quote.contentPredicateIdx) === true) ?? null;
|
|
166
|
+
const sourceUnit = sourceUnitIndex === null ? undefined : options.units[sourceUnitIndex];
|
|
167
|
+
if (sourceUnitIndex === null || sourceUnit === undefined)
|
|
168
|
+
return null;
|
|
169
|
+
const ownerPlan = sourceUnit.renderPlan;
|
|
170
|
+
if (ownerPlan === null)
|
|
171
|
+
return null;
|
|
172
|
+
const requestReportedAsSpeech = quote.slotKind === "request_content" && (quote.hostMatch.requestReportingRole === "speech" || options.targetUnitIndexes.some((unitIndex) => {
|
|
173
|
+
const targetPlan = options.units[unitIndex]?.renderPlan;
|
|
174
|
+
if (targetPlan?.kind === "quoteHostReportingPassive")
|
|
175
|
+
return true;
|
|
176
|
+
if (targetPlan?.kind === "lemma" &&
|
|
177
|
+
(targetPlan.voice === "passive" || targetPlan.forcePassive === true || targetPlan.passiveClass !== undefined))
|
|
178
|
+
return true;
|
|
179
|
+
if (targetPlan?.kind === "attributive" && targetPlan.voice === "passive")
|
|
180
|
+
return true;
|
|
181
|
+
return isPredicateHeadTailChainRenderPlan(targetPlan) &&
|
|
182
|
+
tailRootVoiceOps(targetPlan.realization.root).some((op) => op.voice === "passive");
|
|
183
|
+
}));
|
|
184
|
+
const requestAttributiveHostUnitIndex = quote.slotKind === "request_content"
|
|
185
|
+
? options.targetUnitIndexes.find((unitIndex) => {
|
|
186
|
+
const unit = options.units[unitIndex];
|
|
187
|
+
return unit?.jpIndices.includes(quote.hostMatch.hostIdx) === true &&
|
|
188
|
+
attributiveModifierPlanSourceFacts(unit.renderPlan)?.carriesNonTenseOperator === false;
|
|
189
|
+
})
|
|
190
|
+
: undefined;
|
|
191
|
+
const requestAttributive = requestAttributiveHostUnitIndex !== undefined && (requestReportedAsSpeech || quote.hostMatch.kind === "report");
|
|
192
|
+
if (quote.slotKind === "request_content") {
|
|
193
|
+
if (quote.terminalSfp.effect !== "na_prohib" && quote.terminalSfp.effect !== "na_soft_imperative")
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
const wishProjection = quote.hostMatch.kind === "thought" && quote.terminalSfp.effect === "na_excl"
|
|
197
|
+
? projectSufficiencyWishQuotePlan(ownerPlan)
|
|
198
|
+
: null;
|
|
199
|
+
const nominalRequestFocus = requestReportedAsSpeech ? quote.focusParticle : undefined;
|
|
200
|
+
const projected = wishProjection ?? quoteSfpOwnerInPlacePlan(ownerPlan, quote.terminalSfp, requestReportedAsSpeech, requestAttributive, nominalRequestFocus, quote.terminalSfpMarkerBridgeSpan != null);
|
|
201
|
+
if (projected === null)
|
|
202
|
+
return null;
|
|
203
|
+
const markerUnitIndex = projected.retainQuotativeMarker
|
|
204
|
+
? options.markerUnitIndexes.find((unitIndex) => options.units[unitIndex]?.jpIndices.includes(quote.markerIdx) === true)
|
|
205
|
+
: undefined;
|
|
206
|
+
const markerSharesOwnerUnit = markerUnitIndex === sourceUnitIndex;
|
|
207
|
+
const ownerProjection = projected.retainQuotativeMarker && (markerUnitIndex === undefined || markerSharesOwnerUnit)
|
|
208
|
+
? completeSfpQuoteOwnerPlan(projected.plan, quote.terminalSfp)
|
|
209
|
+
: projected.plan;
|
|
210
|
+
if (ownerProjection === null)
|
|
211
|
+
return null;
|
|
212
|
+
const retainsSeparateMarker = projected.retainQuotativeMarker && markerUnitIndex !== undefined && !markerSharesOwnerUnit;
|
|
213
|
+
const focusParticleKey = quote.focusParticle === "は" ? "은/는"
|
|
214
|
+
: quote.focusParticle === "も" ? "도"
|
|
215
|
+
: quote.focusParticle === "でも" ? "이라도/라도"
|
|
216
|
+
: null;
|
|
217
|
+
const ownerChainRealizesQuoteFocus = isPredicateHeadTailChainRenderPlan(ownerProjection) &&
|
|
218
|
+
ownerProjection.realization.root.sfp?.quoteProjection === "terminal_mood" &&
|
|
219
|
+
ownerProjection.realization.root.sfp.quoteFocusParticle !== undefined;
|
|
220
|
+
const focusedPlan = focusParticleKey === null || retainsSeparateMarker ||
|
|
221
|
+
ownerChainRealizesQuoteFocus ||
|
|
222
|
+
(nominalRequestFocus !== undefined && wishProjection === null)
|
|
223
|
+
? ownerProjection
|
|
224
|
+
: attachParticleRenderPlan(ownerProjection, focusParticleKey);
|
|
225
|
+
if (focusedPlan === null)
|
|
226
|
+
return null;
|
|
227
|
+
const quotativeMarkerUnitIndex = retainsSeparateMarker ? markerUnitIndex : undefined;
|
|
228
|
+
const suppressUnitIndexes = options.markerUnitIndexes.filter((unitIndex) => unitIndex !== quotativeMarkerUnitIndex && unitIndex !== sourceUnitIndex).concat(!requestAttributive || requestAttributiveHostUnitIndex === undefined ? [] : [requestAttributiveHostUnitIndex]);
|
|
229
|
+
return {
|
|
230
|
+
relation: options.relation,
|
|
231
|
+
insertBeforeUnitIndex: sourceUnitIndex,
|
|
232
|
+
suppressUnitIndexes,
|
|
233
|
+
sourceUnitIndexes: options.sourceUnitIndexes,
|
|
234
|
+
targetUnitIndexes: options.targetUnitIndexes,
|
|
235
|
+
projectionTokenIndexes: uniqueSorted([
|
|
236
|
+
...sourceUnit.jpIndices,
|
|
237
|
+
...suppressUnitIndexes.flatMap((unitIndex) => options.units[unitIndex]?.jpIndices ?? []),
|
|
238
|
+
]),
|
|
239
|
+
renderPlan: focusedPlan,
|
|
240
|
+
replaceUnitIndex: sourceUnitIndex,
|
|
241
|
+
...(quotativeMarkerUnitIndex === undefined ? {} : { quotativeMarkerUnitIndex }),
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
function projectSufficiencyWishQuotePlan(plan) {
|
|
245
|
+
if (!isPredicateHeadTailChainRenderPlan(plan))
|
|
246
|
+
return null;
|
|
247
|
+
const ownerPlan = materializeSfpOwnerStem(plan);
|
|
248
|
+
const tail = rewriteSufficiencyWishTail(ownerPlan.realization.root.tail);
|
|
249
|
+
if (tail === null)
|
|
250
|
+
return null;
|
|
251
|
+
const conditionalPlan = {
|
|
252
|
+
...ownerPlan,
|
|
253
|
+
realization: {
|
|
254
|
+
...ownerPlan.realization,
|
|
255
|
+
root: { ...ownerPlan.realization.root, tail, sfp: null },
|
|
256
|
+
},
|
|
257
|
+
};
|
|
258
|
+
const renderPlan = structuralRelationSequencePlan([
|
|
259
|
+
conditionalPlan,
|
|
260
|
+
{ kind: "structuralText", text: " 좋겠다고", koreanPos: 구 },
|
|
261
|
+
]);
|
|
262
|
+
return renderPlan === null ? null : { plan: renderPlan, retainQuotativeMarker: false };
|
|
263
|
+
}
|
|
264
|
+
function rewriteSufficiencyWishTail(node) {
|
|
265
|
+
if (node.kind === "connective") {
|
|
266
|
+
const inner = rewriteSufficiencyWishAuxLayer(node.inner);
|
|
267
|
+
if (inner !== null)
|
|
268
|
+
return { ...node, inner };
|
|
269
|
+
const outer = rewriteSufficiencyWishTail(node.outer);
|
|
270
|
+
return outer === null ? null : { ...node, outer };
|
|
271
|
+
}
|
|
272
|
+
return rewriteSufficiencyWishAuxLayer(node);
|
|
273
|
+
}
|
|
274
|
+
function rewriteSufficiencyWishAuxLayer(layer) {
|
|
275
|
+
const index = layer.ops.findIndex((op) => op.kind === "idiom" && op.idiom === "sufficiency_conditional");
|
|
276
|
+
const idiom = index < 0 ? undefined : layer.ops[index];
|
|
277
|
+
if (idiom === undefined)
|
|
278
|
+
return null;
|
|
279
|
+
const conditional = createConnectiveOp({
|
|
280
|
+
connective: "conditional",
|
|
281
|
+
surface: "ば",
|
|
282
|
+
conditionalFlavor: "plain",
|
|
283
|
+
source: idiom.source,
|
|
284
|
+
});
|
|
285
|
+
const prefixOps = layer.ops.slice(0, index).map((op) => {
|
|
286
|
+
if (op.kind !== "voice" || op.candidates?.includes("potential") !== true)
|
|
287
|
+
return op;
|
|
288
|
+
const { candidates: _candidates, passiveClass: _passiveClass, ...voice } = op;
|
|
289
|
+
return { ...voice, voice: "potential" };
|
|
290
|
+
});
|
|
291
|
+
return {
|
|
292
|
+
...layer,
|
|
293
|
+
terminal: null,
|
|
294
|
+
ops: [...prefixOps, conditional, ...layer.ops.slice(index + 1)],
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
function completeSfpQuoteOwnerPlan(plan, sfp) {
|
|
298
|
+
if (isPredicateHeadTailChainRenderPlan(plan)) {
|
|
299
|
+
return {
|
|
300
|
+
...plan,
|
|
301
|
+
realization: {
|
|
302
|
+
...plan.realization,
|
|
303
|
+
root: {
|
|
304
|
+
...plan.realization.root,
|
|
305
|
+
sfp: { ...(plan.realization.root.sfp ?? sfp), quoteProjection: "terminal_mood" },
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
return structuralRelationSequencePlan([
|
|
311
|
+
plan,
|
|
312
|
+
{ kind: "structuralText", text: "라고", koreanPos: 구 },
|
|
313
|
+
]);
|
|
314
|
+
}
|
|
315
|
+
function quoteSfpOwnerInPlacePlan(plan, sfp, requestReportedAsSpeech = false, requestAttributive = false, nominalRequestFocus, markerSeparatedByPunctuation = false) {
|
|
316
|
+
if (isPredicateHeadTailChainRenderPlan(plan)) {
|
|
317
|
+
const ownerPlan = materializeSfpOwnerStem(plan);
|
|
318
|
+
const terminalStem = firstAuxLayer(ownerPlan.realization.root.tail)?.stem;
|
|
319
|
+
const terminalStemSourceForm = terminalStem?.source.tokens[terminalStem.semanticAnchors[0] ?? 0]?.dictionaryForm ??
|
|
320
|
+
terminalStem?.source.tokens[terminalStem.semanticAnchors[0] ?? 0]?.surface;
|
|
321
|
+
const plainNominalNa = sfp.effect === "na_excl" && sfp.surface === "な" && terminalStem?.kind === "noun" &&
|
|
322
|
+
!tailRootHostLayerGovernsCopulaNiComplement(ownerPlan.realization.root) &&
|
|
323
|
+
!SFP_NA_EXCLAMATORY_NOMINALIZERS.has(terminalStemSourceForm ?? "");
|
|
324
|
+
if (plainNominalNa) {
|
|
325
|
+
const withoutSfp = {
|
|
326
|
+
...ownerPlan,
|
|
327
|
+
realization: {
|
|
328
|
+
...ownerPlan.realization,
|
|
329
|
+
root: { ...ownerPlan.realization.root, sfp: null },
|
|
330
|
+
},
|
|
331
|
+
};
|
|
332
|
+
const quoted = projectHeadTailConnectivePlan(withoutSfp, { connective: "quotative", surface: "" }, sfp.source);
|
|
333
|
+
return quoted === null ? null : { plan: quoted, retainQuotativeMarker: false };
|
|
334
|
+
}
|
|
335
|
+
const imperative = ownerPlan.realization.root.tail.kind === "auxLayer" &&
|
|
336
|
+
ownerPlan.realization.root.tail.terminal === "imperative";
|
|
337
|
+
if (sfp.effect === "na_soft_imperative" &&
|
|
338
|
+
ownerPlan.realization.root.tail.kind === "auxLayer" &&
|
|
339
|
+
ownerPlan.realization.root.tail.stem.kind === "verb" &&
|
|
340
|
+
ownerPlan.realization.root.tail.ops.length === 0) {
|
|
341
|
+
const stem = ownerPlan.realization.root.tail.stem;
|
|
342
|
+
return {
|
|
343
|
+
plan: {
|
|
344
|
+
kind: "conjugatedLemma",
|
|
345
|
+
koreanLemma: stem.lemma,
|
|
346
|
+
irregular: stem.irregular,
|
|
347
|
+
koreanPos: 동사,
|
|
348
|
+
ending: "(으)라고",
|
|
349
|
+
auxTokens: [],
|
|
350
|
+
},
|
|
351
|
+
retainQuotativeMarker: false,
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
const quoteProjection = quoteProjectionForSfpEffect(sfp.effect, imperative);
|
|
355
|
+
if (quoteProjection === "assertive") {
|
|
356
|
+
const withoutSfp = {
|
|
357
|
+
...ownerPlan,
|
|
358
|
+
realization: {
|
|
359
|
+
...ownerPlan.realization,
|
|
360
|
+
root: { ...ownerPlan.realization.root, sfp: null },
|
|
361
|
+
},
|
|
362
|
+
};
|
|
363
|
+
const quoted = projectHeadTailConnectivePlan(withoutSfp, { connective: "quotative", surface: "" }, sfp.source);
|
|
364
|
+
return quoted === null ? null : { plan: quoted, retainQuotativeMarker: false };
|
|
365
|
+
}
|
|
366
|
+
if (quoteProjection === "terminal_mood" && !imperative) {
|
|
367
|
+
if (markerSeparatedByPunctuation) {
|
|
368
|
+
return { plan: ownerPlan, retainQuotativeMarker: true };
|
|
369
|
+
}
|
|
370
|
+
if (sfp.effect === "na_soft_imperative") {
|
|
371
|
+
const withoutSfp = {
|
|
372
|
+
...ownerPlan,
|
|
373
|
+
realization: {
|
|
374
|
+
...ownerPlan.realization,
|
|
375
|
+
root: { ...ownerPlan.realization.root, sfp: null },
|
|
376
|
+
},
|
|
377
|
+
};
|
|
378
|
+
const quoted = projectHeadTailConnectivePlan(withoutSfp, { connective: "quotative", surface: "", quotativeMood: "imperative" }, sfp.source);
|
|
379
|
+
return quoted === null ? null : { plan: quoted, retainQuotativeMarker: false };
|
|
380
|
+
}
|
|
381
|
+
return {
|
|
382
|
+
plan: {
|
|
383
|
+
...ownerPlan,
|
|
384
|
+
realization: {
|
|
385
|
+
...ownerPlan.realization,
|
|
386
|
+
root: {
|
|
387
|
+
...ownerPlan.realization.root,
|
|
388
|
+
sfp: { ...(ownerPlan.realization.root.sfp ?? sfp), quoteProjection: "terminal_mood" },
|
|
389
|
+
},
|
|
390
|
+
},
|
|
391
|
+
},
|
|
392
|
+
retainQuotativeMarker: false,
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
const prohibitiveProjection = requestReportedAsSpeech
|
|
396
|
+
? "reported_request"
|
|
397
|
+
: requestAttributive
|
|
398
|
+
? "attributive_request"
|
|
399
|
+
: "prohibitive";
|
|
400
|
+
const projected = {
|
|
401
|
+
...ownerPlan,
|
|
402
|
+
realization: {
|
|
403
|
+
...ownerPlan.realization,
|
|
404
|
+
root: {
|
|
405
|
+
...ownerPlan.realization.root,
|
|
406
|
+
sfp: quoteProjection === "prohibitive"
|
|
407
|
+
? {
|
|
408
|
+
...(ownerPlan.realization.root.sfp ?? sfp),
|
|
409
|
+
quoteProjection: prohibitiveProjection,
|
|
410
|
+
...(prohibitiveProjection === "reported_request" && nominalRequestFocus !== undefined
|
|
411
|
+
? { quoteFocusParticle: nominalRequestFocus }
|
|
412
|
+
: {}),
|
|
413
|
+
}
|
|
414
|
+
: null,
|
|
415
|
+
},
|
|
416
|
+
},
|
|
417
|
+
};
|
|
418
|
+
if (imperative) {
|
|
419
|
+
const quoted = projectHeadTailConnectivePlan(projected, { connective: "quotative", surface: "", quotativeMood: "imperative" }, sfp.source);
|
|
420
|
+
return quoted === null ? null : { plan: quoted, retainQuotativeMarker: false };
|
|
421
|
+
}
|
|
422
|
+
return { plan: projected, retainQuotativeMarker: false };
|
|
423
|
+
}
|
|
424
|
+
if (plan.kind === "lemma") {
|
|
425
|
+
const predicate = plan.koreanPos === 동사 || plan.koreanPos === 형용사;
|
|
426
|
+
if (sfp.effect === "ka") {
|
|
427
|
+
const questionPlan = { ...plan, sfp: null, terminalSfp: null, connective: "는지" };
|
|
428
|
+
if (plan.koreanPos === 명사)
|
|
429
|
+
return { plan: questionPlan, retainQuotativeMarker: false };
|
|
430
|
+
const quotedQuestion = structuralRelationSequencePlan([
|
|
431
|
+
questionPlan,
|
|
432
|
+
{ kind: "structuralText", text: "라고", koreanPos: 구 },
|
|
433
|
+
]);
|
|
434
|
+
return quotedQuestion === null ? null : { plan: quotedQuestion, retainQuotativeMarker: false };
|
|
435
|
+
}
|
|
436
|
+
if (!predicate) {
|
|
437
|
+
const preserve = quoteProjectionForSfpEffect(sfp.effect, false) === "terminal_mood" &&
|
|
438
|
+
(sfp.effect !== "na_excl" || sfp.surface !== "な" || SFP_NA_EXCLAMATORY_NOMINALIZERS.has(plan.jpDictForm ?? ""));
|
|
439
|
+
return {
|
|
440
|
+
plan: preserve ? plan : { ...plan, auxTokens: [], sfp: null, connective: null },
|
|
441
|
+
retainQuotativeMarker: true,
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
const projected = quoteLemmaSfpOwnerPlan(plan, sfp.effect);
|
|
445
|
+
if (projected === null)
|
|
446
|
+
return null;
|
|
447
|
+
const retain = plan.isImperative !== true &&
|
|
448
|
+
sfp.effect !== "na_prohib" &&
|
|
449
|
+
sfp.effect !== "na_soft_imperative" &&
|
|
450
|
+
quoteProjectionForSfpEffect(sfp.effect, false) === "terminal_mood";
|
|
451
|
+
return { plan: retain ? plan : projected, retainQuotativeMarker: retain };
|
|
452
|
+
}
|
|
453
|
+
if (plan.kind === "copulaPredicate") {
|
|
454
|
+
const preserve = quoteProjectionForSfpEffect(sfp.effect, false) === "terminal_mood";
|
|
455
|
+
return preserve
|
|
456
|
+
? { plan, retainQuotativeMarker: true }
|
|
457
|
+
: { plan: { ...plan, sfp: null, connective: "다고" }, retainQuotativeMarker: false };
|
|
458
|
+
}
|
|
459
|
+
return null;
|
|
460
|
+
}
|
|
461
|
+
function materializeSfpOwnerStem(plan) {
|
|
462
|
+
const materializedTail = clearTailNodeTerminal(materializeTailNodeStem(plan.realization.root.tail));
|
|
463
|
+
return materializedTail === plan.realization.root.tail
|
|
464
|
+
? plan
|
|
465
|
+
: {
|
|
466
|
+
...plan,
|
|
467
|
+
realization: {
|
|
468
|
+
...plan.realization,
|
|
469
|
+
root: { ...plan.realization.root, tail: materializedTail },
|
|
470
|
+
},
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
function clearTailNodeTerminal(node) {
|
|
474
|
+
if (node.kind === "connective") {
|
|
475
|
+
const inner = node.inner.terminal === null ? node.inner : { ...node.inner, terminal: null };
|
|
476
|
+
const outer = clearTailNodeTerminal(node.outer);
|
|
477
|
+
return inner === node.inner && outer === node.outer ? node : { ...node, inner, outer };
|
|
478
|
+
}
|
|
479
|
+
return node.terminal === null ? node : { ...node, terminal: null };
|
|
480
|
+
}
|
|
481
|
+
function materializeTailNodeStem(node) {
|
|
482
|
+
if (node.kind === "connective") {
|
|
483
|
+
const inner = materializeAuxLayerStem(node.inner);
|
|
484
|
+
const outer = materializeTailNodeStem(node.outer);
|
|
485
|
+
return inner === node.inner && outer === node.outer ? node : { ...node, inner, outer };
|
|
486
|
+
}
|
|
487
|
+
return materializeAuxLayerStem(node);
|
|
488
|
+
}
|
|
489
|
+
function materializeAuxLayerStem(node) {
|
|
490
|
+
return resolveCandidateSetLayer(node);
|
|
491
|
+
}
|
|
492
|
+
function quoteLemmaSfpOwnerPlan(sourcePlan, effect) {
|
|
493
|
+
const predicate = sourcePlan.koreanPos === 동사 || sourcePlan.koreanPos === 형용사;
|
|
494
|
+
if (!predicate) {
|
|
495
|
+
return null;
|
|
496
|
+
}
|
|
497
|
+
if (effect === "na_prohib") {
|
|
498
|
+
return {
|
|
499
|
+
kind: "conjugatedLemma",
|
|
500
|
+
koreanLemma: sourcePlan.koreanLemma,
|
|
501
|
+
irregular: sourcePlan.irregular,
|
|
502
|
+
koreanPos: sourcePlan.koreanPos,
|
|
503
|
+
ending: "지 말라고",
|
|
504
|
+
auxTokens: sourcePlan.auxTokens,
|
|
505
|
+
...(typeof sourcePlan.prefix === "string" ? { prefix: sourcePlan.prefix } : {}),
|
|
506
|
+
...(sourcePlan.jpDictForm === undefined ? {} : { jpDictForm: sourcePlan.jpDictForm }),
|
|
507
|
+
...(sourcePlan.verbConjType === undefined ? {} : { verbConjType: sourcePlan.verbConjType }),
|
|
508
|
+
...(sourcePlan.voice === undefined ? {} : { voice: sourcePlan.voice }),
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
if (effect === "na_soft_imperative") {
|
|
512
|
+
return {
|
|
513
|
+
kind: "conjugatedLemma",
|
|
514
|
+
koreanLemma: sourcePlan.koreanLemma,
|
|
515
|
+
irregular: sourcePlan.irregular,
|
|
516
|
+
koreanPos: sourcePlan.koreanPos,
|
|
517
|
+
ending: "(으)라고",
|
|
518
|
+
auxTokens: sourcePlan.auxTokens,
|
|
519
|
+
...(typeof sourcePlan.prefix === "string" ? { prefix: sourcePlan.prefix } : {}),
|
|
520
|
+
...(sourcePlan.jpDictForm === undefined ? {} : { jpDictForm: sourcePlan.jpDictForm }),
|
|
521
|
+
...(sourcePlan.verbConjType === undefined ? {} : { verbConjType: sourcePlan.verbConjType }),
|
|
522
|
+
...(sourcePlan.voice === undefined ? {} : { voice: sourcePlan.voice }),
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
if (sourcePlan.isImperative === true) {
|
|
526
|
+
return {
|
|
527
|
+
kind: "conjugatedLemma",
|
|
528
|
+
koreanLemma: sourcePlan.koreanLemma,
|
|
529
|
+
irregular: sourcePlan.irregular,
|
|
530
|
+
koreanPos: sourcePlan.koreanPos,
|
|
531
|
+
ending: "(으)라고",
|
|
532
|
+
auxTokens: sourcePlan.auxTokens,
|
|
533
|
+
...(typeof sourcePlan.prefix === "string" ? { prefix: sourcePlan.prefix } : {}),
|
|
534
|
+
...(sourcePlan.jpDictForm === undefined ? {} : { jpDictForm: sourcePlan.jpDictForm }),
|
|
535
|
+
...(sourcePlan.verbConjType === undefined ? {} : { verbConjType: sourcePlan.verbConjType }),
|
|
536
|
+
...(sourcePlan.voice === undefined ? {} : { voice: sourcePlan.voice }),
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
if (quoteProjectionForSfpEffect(effect, false) === "terminal_mood") {
|
|
540
|
+
return sourcePlan;
|
|
541
|
+
}
|
|
542
|
+
return {
|
|
543
|
+
...sourcePlan,
|
|
544
|
+
connective: "다고",
|
|
545
|
+
sfp: null,
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
function conditionalClauseSpanAt(graph, conditionalIdx) {
|
|
549
|
+
return graph.nodes
|
|
550
|
+
.filter((node) => node.span.start <= conditionalIdx && conditionalIdx < node.span.endExclusive)
|
|
551
|
+
.sort((left, right) => (left.span.endExclusive - left.span.start) - (right.span.endExclusive - right.span.start))[0]?.span ?? null;
|
|
552
|
+
}
|
|
553
|
+
function conditionalClauseSourceUnitIndexes(graph, units, sourceUnitIndexes, conditionalIdx) {
|
|
554
|
+
const span = conditionalClauseSpanAt(graph, conditionalIdx);
|
|
555
|
+
if (span === null)
|
|
556
|
+
return sourceUnitIndexes;
|
|
557
|
+
return sourceUnitIndexes.filter((unitIndex) => units[unitIndex]?.jpIndices.some((tokenIndex) => span.start <= tokenIndex && tokenIndex < span.endExclusive) === true);
|
|
558
|
+
}
|
|
559
|
+
function rootWithStructuralQuoteMarker(root, quote, markerSource, connective) {
|
|
560
|
+
if (root.tail.kind !== "auxLayer")
|
|
561
|
+
return root;
|
|
562
|
+
const last = root.tail.ops.at(-1);
|
|
563
|
+
if (last?.kind === "connective" &&
|
|
564
|
+
(last.connective === "quotative" ||
|
|
565
|
+
last.connective === "question_quotative" ||
|
|
566
|
+
last.connective === "wish_complement")) {
|
|
567
|
+
return root;
|
|
568
|
+
}
|
|
569
|
+
const markerConnective = createConnectiveOp({
|
|
570
|
+
connective,
|
|
571
|
+
surface: quote.markerBaseSurface,
|
|
572
|
+
source: markerSource,
|
|
573
|
+
});
|
|
574
|
+
return {
|
|
575
|
+
...root,
|
|
576
|
+
tail: { ...root.tail, ops: [...root.tail.ops, markerConnective] },
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
function thoughtHostHasConditionalContinuation(options) {
|
|
580
|
+
const hostUnitIndex = sourceUnitIndexesWithToken(options.units, options.targetUnitIndexes, options.hostIdx).find((unitIndex) => isPredicateHeadTailChainRenderPlan(options.units[unitIndex]?.renderPlan ?? null));
|
|
581
|
+
if (hostUnitIndex === undefined)
|
|
582
|
+
return false;
|
|
583
|
+
const plan = options.units[hostUnitIndex]?.renderPlan;
|
|
584
|
+
if (!isPredicateHeadTailChainRenderPlan(plan) || plan.realization.root.tail.kind !== "auxLayer") {
|
|
585
|
+
return false;
|
|
586
|
+
}
|
|
587
|
+
const finalOp = plan.realization.root.tail.ops.at(-1);
|
|
588
|
+
return finalOp?.kind === "connective" && finalOp.connective === "conditional";
|
|
589
|
+
}
|
|
590
|
+
function rootHasDirectPositivePotentialRecipientBenefactiveWishEvidence(root) {
|
|
591
|
+
if (root.tail.kind !== "auxLayer")
|
|
592
|
+
return false;
|
|
593
|
+
return root.tail.ops.some((op, index, ops) => {
|
|
594
|
+
if (!isBenefactiveAspectOp(op) ||
|
|
595
|
+
!op.benefactive.potential ||
|
|
596
|
+
(op.benefactive.kind !== "morau" && op.benefactive.kind !== "itadaku")) {
|
|
597
|
+
return false;
|
|
598
|
+
}
|
|
599
|
+
const conditional = ops[index + 1];
|
|
600
|
+
return conditional?.kind === "connective" && conditional.connective === "conditional";
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
function quoteMarkerDirectlyPrecedesHost(tokens, quote) {
|
|
604
|
+
const hostStart = quote.hostMatch.supportIdx ?? quote.hostMatch.hostIdx;
|
|
605
|
+
const previous = previousNonSpaceIndex(tokens, hostStart);
|
|
606
|
+
return previous !== null &&
|
|
607
|
+
quote.markerSpan.start <= previous &&
|
|
608
|
+
previous < quote.markerSpan.endExclusive;
|
|
609
|
+
}
|
|
610
|
+
export function buildConditionalWishQuoteStructuredRenderOperation(options) {
|
|
611
|
+
const relation = options.relation;
|
|
612
|
+
const quote = relation.quote;
|
|
613
|
+
if (quote === undefined ||
|
|
614
|
+
!((quote.slotKind === "quoted_content" && quote.hostMatch.kind === "thought") ||
|
|
615
|
+
(quote.slotKind === "wish_content" && quote.hostMatch.kind === "wish")) ||
|
|
616
|
+
quote.contentSpan.endExclusive !== quote.markerIdx) {
|
|
617
|
+
return null;
|
|
618
|
+
}
|
|
619
|
+
if (quote.conditionalContent?.subtype !== "affirmative_wish") {
|
|
620
|
+
return null;
|
|
621
|
+
}
|
|
622
|
+
const thoughtHostConditionalContinuation = quote.hostMatch.kind === "thought" &&
|
|
623
|
+
thoughtHostHasConditionalContinuation({
|
|
624
|
+
units: options.units,
|
|
625
|
+
targetUnitIndexes: options.targetUnitIndexes,
|
|
626
|
+
hostIdx: quote.hostMatch.hostIdx,
|
|
627
|
+
});
|
|
628
|
+
const conditionalIdx = quote.conditionalContent.tokenIdx;
|
|
629
|
+
const predicateUnitIndex = sourceUnitIndexesWithToken(options.units, uniqueSorted([...options.sourceUnitIndexes, ...options.markerUnitIndexes]), conditionalIdx)
|
|
630
|
+
.find((unitIndex) => options.units[unitIndex]?.renderPlan?.kind === "headTailChain") ?? null;
|
|
631
|
+
const predicateUnit = predicateUnitIndex === null ? undefined : options.units[predicateUnitIndex];
|
|
632
|
+
if (predicateUnitIndex === null || predicateUnit === undefined || predicateUnit.unitType === UnitType.SYMBOL) {
|
|
633
|
+
return null;
|
|
634
|
+
}
|
|
635
|
+
const predicateRenderPlan = predicateUnit.renderPlan;
|
|
636
|
+
if (!isPredicateHeadTailChainRenderPlan(predicateRenderPlan) ||
|
|
637
|
+
predicateRenderPlan.realization.root.tail.kind !== "auxLayer") {
|
|
638
|
+
return null;
|
|
639
|
+
}
|
|
640
|
+
if (thoughtHostConditionalContinuation &&
|
|
641
|
+
!rootHasDirectPositivePotentialRecipientBenefactiveWishEvidence(predicateRenderPlan.realization.root)) {
|
|
642
|
+
return null;
|
|
643
|
+
}
|
|
644
|
+
const quoteMarkerSource = opSourceForMarkerSpans(options.tokens, relation.markerSpans);
|
|
645
|
+
if (quoteMarkerSource === null) {
|
|
646
|
+
return null;
|
|
647
|
+
}
|
|
648
|
+
const productionRoot = rootWithStructuralQuoteMarker(predicateRenderPlan.realization.root, quote, quoteMarkerSource, "wish_complement");
|
|
649
|
+
const productionDispatch = probeProductionDispatch(productionRoot, {
|
|
650
|
+
relations: [relation],
|
|
651
|
+
intake: { site: "committed_render", partial: false }
|
|
652
|
+
});
|
|
653
|
+
if (productionDispatch.kind !== "registry" ||
|
|
654
|
+
!isConditionalQuoteProductionMatch(productionDispatch.match)) {
|
|
655
|
+
return null;
|
|
656
|
+
}
|
|
657
|
+
const predicatePlan = projectUnitWithoutQuoteMarkerConnectivePlan(predicateUnit, quoteMarkerSource, rootHasDirectPositivePotentialRecipientBenefactiveWishEvidence(predicateRenderPlan.realization.root) ||
|
|
658
|
+
quoteMarkerDirectlyPrecedesHost(options.tokens, quote), normalizeProductionMatch(productionRoot, productionDispatch.match));
|
|
659
|
+
if (predicatePlan === null) {
|
|
660
|
+
return null;
|
|
661
|
+
}
|
|
662
|
+
const localSourceUnitIndexes = conditionalClauseSourceUnitIndexes(options.graph, options.units, options.sourceUnitIndexes, conditionalIdx);
|
|
663
|
+
const conditionalClauseSpan = conditionalClauseSpanAt(options.graph, conditionalIdx) ?? quote.contentSpan;
|
|
664
|
+
const internalSymbolUnitIndexes = unitIndexesInSpan(options.units, conditionalClauseSpan)
|
|
665
|
+
.filter((unitIndex) => options.units[unitIndex]?.unitType === UnitType.SYMBOL);
|
|
666
|
+
const wishSourceUnitIndexes = uniqueSorted([
|
|
667
|
+
...localSourceUnitIndexes,
|
|
668
|
+
...internalSymbolUnitIndexes,
|
|
669
|
+
]);
|
|
670
|
+
const sourcePlan = composeRelationSourceUnitPlans(options.tokens, options.units, wishSourceUnitIndexes, new Map([[predicateUnitIndex, predicatePlan]]));
|
|
671
|
+
if (sourcePlan === null) {
|
|
672
|
+
return null;
|
|
673
|
+
}
|
|
674
|
+
const thoughtSuffix = {
|
|
675
|
+
kind: "structuralText",
|
|
676
|
+
text: " 좋겠다고",
|
|
677
|
+
koreanPos: 구,
|
|
678
|
+
sourceSpan: sourceSpanForStructuralTokenSpan(options.tokens, relation.markerSpans[0] ?? quote.markerSpan),
|
|
679
|
+
};
|
|
680
|
+
const renderPlan = structuralRelationSequencePlan([sourcePlan, thoughtSuffix]);
|
|
681
|
+
if (renderPlan === null) {
|
|
682
|
+
return null;
|
|
683
|
+
}
|
|
684
|
+
const suppressUnitIndexes = uniqueSorted([...wishSourceUnitIndexes, ...options.markerUnitIndexes]);
|
|
685
|
+
return {
|
|
686
|
+
relation,
|
|
687
|
+
insertBeforeUnitIndex: wishSourceUnitIndexes[0] ?? predicateUnitIndex,
|
|
688
|
+
suppressUnitIndexes,
|
|
689
|
+
sourceUnitIndexes: wishSourceUnitIndexes,
|
|
690
|
+
targetUnitIndexes: options.targetUnitIndexes,
|
|
691
|
+
projectionTokenIndexes: uniqueSorted(suppressUnitIndexes.flatMap((candidateIndex) => (options.units[candidateIndex]?.jpIndices ?? []))),
|
|
692
|
+
renderPlan,
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
export function buildConditionalThoughtQuoteMarkerStructuredRenderOperation(options) {
|
|
696
|
+
const relation = options.relation;
|
|
697
|
+
const quote = relation.quote;
|
|
698
|
+
const conditionalContent = quote?.conditionalContent;
|
|
699
|
+
const conditionalSubtype = conditionalContent?.subtype;
|
|
700
|
+
const continuationHandoff = quote !== undefined &&
|
|
701
|
+
conditionalSubtype === "affirmative_wish" &&
|
|
702
|
+
thoughtHostHasConditionalContinuation({
|
|
703
|
+
units: options.units,
|
|
704
|
+
targetUnitIndexes: options.targetUnitIndexes,
|
|
705
|
+
hostIdx: quote.hostMatch.hostIdx,
|
|
706
|
+
});
|
|
707
|
+
if (quote === undefined ||
|
|
708
|
+
quote.slotKind !== "quoted_content" ||
|
|
709
|
+
quote.hostMatch.kind !== "thought" ||
|
|
710
|
+
quote.contentSpan.endExclusive !== quote.markerIdx ||
|
|
711
|
+
conditionalContent === undefined ||
|
|
712
|
+
!(conditionalSubtype === "conditional" || continuationHandoff)) {
|
|
713
|
+
return null;
|
|
714
|
+
}
|
|
715
|
+
const conditionalIdx = conditionalContent.tokenIdx;
|
|
716
|
+
const predicateUnitIndex = sourceUnitIndexesWithToken(options.units, uniqueSorted([...options.sourceUnitIndexes, ...options.markerUnitIndexes]), conditionalIdx)
|
|
717
|
+
.find((unitIndex) => options.units[unitIndex]?.renderPlan?.kind === "headTailChain") ?? null;
|
|
718
|
+
const predicateUnit = predicateUnitIndex === null ? undefined : options.units[predicateUnitIndex];
|
|
719
|
+
if (predicateUnitIndex === null || predicateUnit === undefined || predicateUnit.unitType === UnitType.SYMBOL) {
|
|
720
|
+
return null;
|
|
721
|
+
}
|
|
722
|
+
const quoteMarkerSource = opSourceForMarkerSpans(options.tokens, relation.markerSpans);
|
|
723
|
+
const predicateRenderPlan = predicateUnit.renderPlan;
|
|
724
|
+
if (!isPredicateHeadTailChainRenderPlan(predicateRenderPlan) ||
|
|
725
|
+
predicateRenderPlan.realization.root.tail.kind !== "auxLayer" ||
|
|
726
|
+
quoteMarkerSource === null) {
|
|
727
|
+
return null;
|
|
728
|
+
}
|
|
729
|
+
const productionRoot = rootWithStructuralQuoteMarker(predicateRenderPlan.realization.root, quote, quoteMarkerSource, "quotative");
|
|
730
|
+
const productionDispatch = probeProductionDispatch(productionRoot, {
|
|
731
|
+
relations: [relation],
|
|
732
|
+
intake: { site: "committed_render", partial: false },
|
|
733
|
+
});
|
|
734
|
+
if (productionDispatch.kind !== "registry" ||
|
|
735
|
+
!isConditionalQuoteProductionMatch(productionDispatch.match)) {
|
|
736
|
+
return null;
|
|
737
|
+
}
|
|
738
|
+
if (continuationHandoff &&
|
|
739
|
+
rootHasDirectPositivePotentialRecipientBenefactiveWishEvidence(predicateRenderPlan.realization.root)) {
|
|
740
|
+
return null;
|
|
741
|
+
}
|
|
742
|
+
const predicatePlan = projectUnitWithoutQuoteMarkerConnectivePlan(predicateUnit, quoteMarkerSource, continuationHandoff, normalizeProductionMatch(productionRoot, productionDispatch.match));
|
|
743
|
+
const obligationPlan = predicatePlan === null
|
|
744
|
+
? null
|
|
745
|
+
: continuationHandoff
|
|
746
|
+
? predicatePlan
|
|
747
|
+
: projectNegativeConditionalObligationPlan(predicatePlan, options.tokens, conditionalIdx) ?? predicatePlan;
|
|
748
|
+
const quotedPredicatePlan = obligationPlan === null
|
|
749
|
+
? null
|
|
750
|
+
: projectHeadTailConnectivePlan(obligationPlan, { connective: "quotative", surface: quote.markerBaseSurface }, quoteMarkerSource, false, null, "append");
|
|
751
|
+
if (quotedPredicatePlan === null) {
|
|
752
|
+
return null;
|
|
753
|
+
}
|
|
754
|
+
const sourcePlan = composeRelationSourceUnitPlans(options.tokens, options.units, options.sourceUnitIndexes, new Map([[predicateUnitIndex, quotedPredicatePlan]]));
|
|
755
|
+
if (sourcePlan === null) {
|
|
756
|
+
return null;
|
|
757
|
+
}
|
|
758
|
+
const suppressUnitIndexes = uniqueSorted([...options.sourceUnitIndexes, ...options.markerUnitIndexes])
|
|
759
|
+
.filter((unitIndex) => options.units[unitIndex]?.unitType !== UnitType.SYMBOL);
|
|
760
|
+
return {
|
|
761
|
+
relation,
|
|
762
|
+
insertBeforeUnitIndex: options.sourceUnitIndexes[0] ?? predicateUnitIndex,
|
|
763
|
+
suppressUnitIndexes,
|
|
764
|
+
sourceUnitIndexes: options.sourceUnitIndexes,
|
|
765
|
+
targetUnitIndexes: options.targetUnitIndexes,
|
|
766
|
+
projectionTokenIndexes: uniqueSorted(suppressUnitIndexes.flatMap((candidateIndex) => (options.units[candidateIndex]?.jpIndices ?? []))),
|
|
767
|
+
renderPlan: sourcePlan,
|
|
768
|
+
};
|
|
769
|
+
}
|
|
770
|
+
export function buildConditionalReportQuoteStructuredRenderOperation(options) {
|
|
771
|
+
const relation = options.relation;
|
|
772
|
+
const quote = relation.quote;
|
|
773
|
+
if (quote === undefined ||
|
|
774
|
+
quote.slotKind !== "quoted_content" ||
|
|
775
|
+
quote.contentSpan.endExclusive !== quote.markerIdx ||
|
|
776
|
+
quote.hostMatch.kind !== "report" ||
|
|
777
|
+
quote.conditionalContent === undefined) {
|
|
778
|
+
return null;
|
|
779
|
+
}
|
|
780
|
+
const conditionalIdx = quote.conditionalContent.tokenIdx;
|
|
781
|
+
const predicateUnitIndex = sourceUnitIndexesWithToken(options.units, uniqueSorted([...options.sourceUnitIndexes, ...options.markerUnitIndexes]), conditionalIdx)
|
|
782
|
+
.find((unitIndex) => options.units[unitIndex]?.renderPlan?.kind === "headTailChain") ?? null;
|
|
783
|
+
const predicateUnit = predicateUnitIndex === null ? undefined : options.units[predicateUnitIndex];
|
|
784
|
+
if (predicateUnitIndex === null || predicateUnit === undefined || predicateUnit.unitType === UnitType.SYMBOL) {
|
|
785
|
+
return null;
|
|
786
|
+
}
|
|
787
|
+
const predicatePlan = projectUnitWithoutQuoteMarkerConnectivePlan(predicateUnit, opSourceForMarkerSpans(options.tokens, relation.markerSpans));
|
|
788
|
+
if (predicatePlan === null) {
|
|
789
|
+
return null;
|
|
790
|
+
}
|
|
791
|
+
const internalSymbolUnitIndexes = unitIndexesInSpan(options.units, quote.contentSpan)
|
|
792
|
+
.filter((unitIndex) => options.units[unitIndex]?.unitType === UnitType.SYMBOL);
|
|
793
|
+
const reportSourceUnitIndexes = uniqueSorted([
|
|
794
|
+
...options.sourceUnitIndexes,
|
|
795
|
+
...internalSymbolUnitIndexes,
|
|
796
|
+
]);
|
|
797
|
+
const sourcePlan = composeRelationSourceUnitPlans(options.tokens, options.units, reportSourceUnitIndexes, new Map([[predicateUnitIndex, predicatePlan]]));
|
|
798
|
+
if (sourcePlan === null) {
|
|
799
|
+
return null;
|
|
800
|
+
}
|
|
801
|
+
const quoteSuffix = {
|
|
802
|
+
kind: "structuralText",
|
|
803
|
+
text: " 하고",
|
|
804
|
+
koreanPos: 구,
|
|
805
|
+
sourceSpan: sourceSpanForStructuralTokenSpan(options.tokens, relation.markerSpans[0] ?? quote.markerSpan),
|
|
806
|
+
};
|
|
807
|
+
const renderPlan = structuralRelationSequencePlan([sourcePlan, quoteSuffix]);
|
|
808
|
+
if (renderPlan === null) {
|
|
809
|
+
return null;
|
|
810
|
+
}
|
|
811
|
+
const suppressUnitIndexes = uniqueSorted([...reportSourceUnitIndexes, ...options.markerUnitIndexes]);
|
|
812
|
+
return {
|
|
813
|
+
relation,
|
|
814
|
+
insertBeforeUnitIndex: reportSourceUnitIndexes[0] ?? predicateUnitIndex,
|
|
815
|
+
suppressUnitIndexes,
|
|
816
|
+
sourceUnitIndexes: reportSourceUnitIndexes,
|
|
817
|
+
targetUnitIndexes: options.targetUnitIndexes,
|
|
818
|
+
projectionTokenIndexes: uniqueSorted(suppressUnitIndexes.flatMap((unitIndex) => (options.units[unitIndex]?.jpIndices ?? []))),
|
|
819
|
+
renderPlan,
|
|
820
|
+
};
|
|
821
|
+
}
|
|
822
|
+
function projectNegativeConditionalObligationPlan(plan, tokens, conditionalIdx) {
|
|
823
|
+
const tail = plan.realization.root.tail;
|
|
824
|
+
if (tail.kind !== "auxLayer")
|
|
825
|
+
return null;
|
|
826
|
+
const conditionalOpIdx = tail.ops.findIndex((op) => op.kind === "connective" && op.source.tokenIndices.includes(conditionalIdx));
|
|
827
|
+
if (conditionalOpIdx < 0)
|
|
828
|
+
return null;
|
|
829
|
+
let negationOpIdx = -1;
|
|
830
|
+
for (let index = conditionalOpIdx - 1; index >= 0; index -= 1) {
|
|
831
|
+
if (tail.ops[index]?.kind === "negation") {
|
|
832
|
+
negationOpIdx = index;
|
|
833
|
+
break;
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
if (negationOpIdx < 0)
|
|
837
|
+
return null;
|
|
838
|
+
const negationOp = tail.ops[negationOpIdx];
|
|
839
|
+
const sourceIndices = uniqueSorted([...negationOp.source.tokenIndices, conditionalIdx]);
|
|
840
|
+
const obligation = createIdiomOp({
|
|
841
|
+
idiom: "obligation",
|
|
842
|
+
variant: tokens[conditionalIdx]?.surface === "ば" ? "standard_nakereba" : "colloquial_naito_elided",
|
|
843
|
+
polarity: "affirmative",
|
|
844
|
+
polite: false,
|
|
845
|
+
past: false,
|
|
846
|
+
source: {
|
|
847
|
+
tokens: sourceIndices.flatMap((index) => tokens[index] === undefined ? [] : [tokens[index]]),
|
|
848
|
+
tokenIndices: sourceIndices,
|
|
849
|
+
},
|
|
850
|
+
});
|
|
851
|
+
const ops = tail.ops.filter((_, index) => index !== negationOpIdx && index !== conditionalOpIdx);
|
|
852
|
+
ops.splice(Math.min(negationOpIdx, ops.length), 0, obligation);
|
|
853
|
+
return {
|
|
854
|
+
...plan,
|
|
855
|
+
realization: {
|
|
856
|
+
...plan.realization,
|
|
857
|
+
root: {
|
|
858
|
+
...plan.realization.root,
|
|
859
|
+
tail: { ...tail, ops },
|
|
860
|
+
},
|
|
861
|
+
},
|
|
862
|
+
};
|
|
863
|
+
}
|
|
864
|
+
export function buildPredicateBoundTameQuoteStructuredRenderOperation(options) {
|
|
865
|
+
const relation = options.relation;
|
|
866
|
+
const quote = relation.quote;
|
|
867
|
+
if (quote === undefined || quote.slotKind !== "quoted_content") {
|
|
868
|
+
return null;
|
|
869
|
+
}
|
|
870
|
+
const tameIdx = previousNonSpaceTokenIndex(options.tokens, quote.markerIdx);
|
|
871
|
+
const tame = tameIdx === null ? undefined : options.tokens[tameIdx];
|
|
872
|
+
const tameForm = tame?.dictionaryForm || tame?.surface;
|
|
873
|
+
if (tameIdx === null ||
|
|
874
|
+
tameIdx < quote.contentSpan.start ||
|
|
875
|
+
tameIdx >= quote.contentSpan.endExclusive ||
|
|
876
|
+
(tameForm !== "ため" && tameForm !== "為")) {
|
|
877
|
+
return null;
|
|
878
|
+
}
|
|
879
|
+
const sourceUnitIndex = sourceUnitIndexesWithPredicateBoundTame(options.units, options.sourceUnitIndexes, tameIdx)[0] ?? null;
|
|
880
|
+
const sourceUnit = sourceUnitIndex === null ? undefined : options.units[sourceUnitIndex];
|
|
881
|
+
if (sourceUnitIndex === null || sourceUnit === undefined || sourceUnit.unitType === UnitType.SYMBOL || sourceUnit.renderPlan === null) {
|
|
882
|
+
return null;
|
|
883
|
+
}
|
|
884
|
+
const sourcePlan = projectUnitPredicateConnectivePlan(sourceUnit, predicateBoundTameQuoteConnective(sourceUnit, options.tokens, tameIdx, tame?.surface ?? "ため", options.lookups)) ?? sourceUnit.renderPlan;
|
|
885
|
+
const quotedPlan = attachParticleRenderPlan(sourcePlan, "이라고/라고");
|
|
886
|
+
if (quotedPlan === null) {
|
|
887
|
+
return null;
|
|
888
|
+
}
|
|
889
|
+
const suppressUnitIndexes = uniqueSorted([sourceUnitIndex, ...options.markerUnitIndexes])
|
|
890
|
+
.filter((candidateIndex) => options.units[candidateIndex]?.unitType !== UnitType.SYMBOL);
|
|
891
|
+
return {
|
|
892
|
+
relation,
|
|
893
|
+
insertBeforeUnitIndex: sourceUnitIndex,
|
|
894
|
+
suppressUnitIndexes,
|
|
895
|
+
sourceUnitIndexes: options.sourceUnitIndexes,
|
|
896
|
+
targetUnitIndexes: options.targetUnitIndexes,
|
|
897
|
+
projectionTokenIndexes: uniqueSorted(suppressUnitIndexes.flatMap((candidateIndex) => (options.units[candidateIndex]?.jpIndices ?? []))),
|
|
898
|
+
renderPlan: quotedPlan,
|
|
899
|
+
};
|
|
900
|
+
}
|
|
901
|
+
function sourceUnitIndexesWithPredicateBoundTame(units, sourceUnitIndexes, tameIdx) {
|
|
902
|
+
return sourceUnitIndexes.filter((unitIndex) => {
|
|
903
|
+
const unit = units[unitIndex];
|
|
904
|
+
return unit !== undefined &&
|
|
905
|
+
unit.renderPlan?.kind === "headTailChain" &&
|
|
906
|
+
unit.jpIndices.includes(tameIdx);
|
|
907
|
+
});
|
|
908
|
+
}
|
|
909
|
+
function projectUnitWithoutQuoteMarkerConnectivePlan(unit, quoteMarkerSource, allowSeparatedMarker = false, registryNormalizedRoot = null) {
|
|
910
|
+
const plan = unit.renderPlan;
|
|
911
|
+
if (!isPredicateHeadTailChainRenderPlan(plan) ||
|
|
912
|
+
plan.realization.root.tail.kind !== "auxLayer" ||
|
|
913
|
+
quoteMarkerSource === null ||
|
|
914
|
+
(registryNormalizedRoot !== null && registryNormalizedRoot.tail.kind !== "auxLayer")) {
|
|
915
|
+
return null;
|
|
916
|
+
}
|
|
917
|
+
const layer = plan.realization.root.tail;
|
|
918
|
+
const ownsQuoteMarker = layer.ops.some((op) => op.kind === "connective" && opSourceCoveredBy(op.source, quoteMarkerSource));
|
|
919
|
+
if (!ownsQuoteMarker && !allowSeparatedMarker) {
|
|
920
|
+
return null;
|
|
921
|
+
}
|
|
922
|
+
const normalizedLayer = registryNormalizedRoot?.tail.kind === "auxLayer"
|
|
923
|
+
? registryNormalizedRoot.tail
|
|
924
|
+
: null;
|
|
925
|
+
const projectedOps = (normalizedLayer?.ops ?? layer.ops.filter((op) => !(op.kind === "connective" && opSourceCoveredBy(op.source, quoteMarkerSource)))).map((op) => (op.kind === "connective" && op.connective === "conditional" && op.surface === "ば"
|
|
926
|
+
? { ...op, conditionalFlavor: "plain" }
|
|
927
|
+
: op));
|
|
928
|
+
const projectedLayer = {
|
|
929
|
+
...(normalizedLayer ?? layer),
|
|
930
|
+
ops: projectedOps,
|
|
931
|
+
terminal: null,
|
|
932
|
+
};
|
|
933
|
+
const projectedRoot = {
|
|
934
|
+
...(registryNormalizedRoot ?? plan.realization.root),
|
|
935
|
+
tail: projectedLayer,
|
|
936
|
+
};
|
|
937
|
+
const lastConnective = [...projectedOps].reverse().find((op) => op.kind === "connective") ?? null;
|
|
938
|
+
const projectedBoundary = lastConnective === null
|
|
939
|
+
? { kind: "terminal" }
|
|
940
|
+
: connectiveBoundaryForProjection(plan, { connective: lastConnective.connective, surface: lastConnective.surface }, lastConnective.source);
|
|
941
|
+
const { headTailCandidate: _headTailCandidate, headTailSourceCandidate: _headTailSourceCandidate, ...planWithoutOriginalSourceCandidate } = plan;
|
|
942
|
+
const { partial: _partial, ...realizationWithoutPartial } = plan.realization;
|
|
943
|
+
return {
|
|
944
|
+
...planWithoutOriginalSourceCandidate,
|
|
945
|
+
clauseRole: { ...plan.clauseRole, outgoingBoundary: projectedBoundary },
|
|
946
|
+
realization: {
|
|
947
|
+
...realizationWithoutPartial,
|
|
948
|
+
root: projectedRoot,
|
|
949
|
+
warnings: resolvedStructuralProjectionWarnings(plan.realization.warnings),
|
|
950
|
+
},
|
|
951
|
+
};
|
|
952
|
+
}
|
|
953
|
+
function predicateBoundTameQuoteConnective(unit, tokens, tameIdx, surface, lookups) {
|
|
954
|
+
const plan = unit.renderPlan;
|
|
955
|
+
return {
|
|
956
|
+
connective: plan?.kind === "headTailChain" &&
|
|
957
|
+
plan.realization.kind === "predicate" &&
|
|
958
|
+
tailPredicateHostPrefersTameReason({
|
|
959
|
+
root: plan.realization.root,
|
|
960
|
+
tokens,
|
|
961
|
+
tameIndex: tameIdx,
|
|
962
|
+
lookups,
|
|
963
|
+
})
|
|
964
|
+
? "tame_reason"
|
|
965
|
+
: "tame_purpose",
|
|
966
|
+
surface,
|
|
967
|
+
};
|
|
968
|
+
}
|