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
|
@@ -3,8 +3,7 @@ import { asIrregular, conjugate } from "../../generator/conjugator.js";
|
|
|
3
3
|
import { realizeNumeral } from "../../generator/numeral-realization.js";
|
|
4
4
|
import { hasBatchim, selectParticle } from "../../generator/particles.js";
|
|
5
5
|
import { allomorphReadingForRealizedText, quantityUnitPhraseReading, trailingAllomorphHostText } from "./allomorph-host.js";
|
|
6
|
-
import {
|
|
7
|
-
import { rederiveStemDerivation } from "./stem-derivation.js";
|
|
6
|
+
import { longNegativeLemma, stripFirstNegativeAux } from "./negative-polish.js";
|
|
8
7
|
import { resolveAttributive, resolveAttributiveForTail } from "../attributive.js";
|
|
9
8
|
import { nodaAttributive, renderKamoShirenaiTail } from "../semantics/grammar-runtime.js";
|
|
10
9
|
import { resolveCopulaAdj } from "../semantics/copula-tail-runtime.js";
|
|
@@ -12,27 +11,18 @@ import { normalizeGiveRequest } from "./request-normalization.js";
|
|
|
12
11
|
import { PRONOUN_POSSESSIVE_CONTRACTIONS, PRONOUN_SUBJECT_CONTRACTIONS } from "../pronominal-no-dispatch.js";
|
|
13
12
|
import { pronominalNoNominalHeadSurface } from "../nominal-phrase-surface.js";
|
|
14
13
|
import { metadataIrregular, metadataKoreanPolite, metadataKoreanPos, metadataTeIruResultative } from "../translation/metadata.js";
|
|
15
|
-
import { renderTail, renderTailPredicateGerundProjection, renderTailWithSourceTargetTrace } from "../head-tail/tail/predicate-root/render.js";
|
|
14
|
+
import { renderTail, renderTailPredicateGerundProjection, renderTailWithSourceTargetTrace } from "../head-tail/tail/predicate-root/render-root.js";
|
|
16
15
|
import { buildSharedTailChainRenderResult, commitSharedTailParserGerundRoot, commitSharedTailParserChain, commitSharedTailParserRoot, renderHeadTailChainRenderPlan, withProjectedHostBase } from "../head-tail/lifecycle/render.js";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { clauseRoleCommitContext } from "../head-tail/lifecycle/commit-context.js";
|
|
16
|
+
import { firstAuxLayer } from "../head-tail/tail/predicate-root/inspect.js";
|
|
17
|
+
import { lemmaEffectiveConnective } from "../head-tail/lifecycle/rewrite.js";
|
|
20
18
|
import { commitTail, resolveCandidateSetStem } from "../head-tail/tail/predicate-root/commit.js";
|
|
21
|
-
import { renderAniTerminal } from "../head-tail/tail/korean-terminal.js";
|
|
22
|
-
import { renderRepeatedFunctionalChainText } from "./functional-chain.js";
|
|
23
19
|
import { isWideScopeNegativeSurfaceCarrierAuxiliary } from "../semantics/surface-carrier-auxiliaries.js";
|
|
24
20
|
import { isNominalHeadTailChainRenderPlan, isPredicateHeadTailChainRenderPlan } from "../../types/render-plan.js";
|
|
25
|
-
import { POS4,
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
if (options.isPotential === true) {
|
|
32
|
-
return "potential";
|
|
33
|
-
}
|
|
34
|
-
return "active";
|
|
35
|
-
}
|
|
21
|
+
import { POS4, 助動詞, 助動詞_タ, 助動詞_タイ, 助動詞_ナイ, 助動詞_ヌ, 助動詞_マス, 助動詞_レル, 動詞, 形容詞0, 終止形_一般, 連体形_一般, 감탄사, 대명사, 동사, 명사, 형용사, isAssertiveCopulaFamilyPos, isPastAuxiliaryPos, isPoliteCopulaPos } from "../../types/pos.js";
|
|
22
|
+
import { attachUnitToRenderedTarget, semanticRenderedTargetSegment, appendOwnerTemplateText, appendRenderedTarget, appendOwnerSuffixTrace, trimRenderedTargetSuffix, renderedTargetFromSegments, renderedTargetText, nonIdentityAllomorphHost, allomorphHostOfRenderedTarget, withFusedParticleSourceSpan, withParticleSourceProvenance, syntheticTargetSegment, sourceSpanForRuntimeTokens, sourceSpanForRuntimeTokenIndexes, combineSourceSpans, renderPlanTargetSegmentKind, renderPlanProjectionConfidence, sourceBoundaryBefore, sourceBoundaryAfter } from "./render-plan-segments.js";
|
|
23
|
+
import { nominalHeadTailHostTrace, nominalHeadTailRestTraceSegments } from "./nominal-head-tail-plan-trace.js";
|
|
24
|
+
import { realizeFunctionalChainResidual } from "./functional-chain.js";
|
|
25
|
+
import { youdaModalityPayload, reasonBecausePayload, nominalConnectiveScopePayload, nominalDemoAruPayload, auxTokensOf, shouldRewriteSurfacePrefixOnConnective, shouldRewriteSurfaceSuffixOnConnective, isRenderPlan } from "./render-plan-payloads.js";
|
|
36
26
|
const NOUN_CONNECTIVE_FALLBACKS = new Set(["고", "지만", "면", "라면", "며", "아/어서", "(으)니까", "(으)면서", "(으)면서도"]);
|
|
37
27
|
function realizeRenderPlanText(plan, options) {
|
|
38
28
|
const lookups = options.lookups;
|
|
@@ -329,329 +319,6 @@ function realizeNominalHeadTailChainWithTrace(plan, options) {
|
|
|
329
319
|
const rendered = renderedTargetFromSegments([...host.segments, ...restSegments]);
|
|
330
320
|
return rendered.text === expected ? rendered : null;
|
|
331
321
|
}
|
|
332
|
-
function nominalHeadTailHostTrace(plan, options, numeric) {
|
|
333
|
-
switch (plan.realization.root.kind) {
|
|
334
|
-
case "predicateNominalHost":
|
|
335
|
-
return predicateNominalHostTrace(plan, options, numeric);
|
|
336
|
-
case "nominalPhrase":
|
|
337
|
-
return nominalPhraseHeadTrace(plan);
|
|
338
|
-
case "hostBearingLikeness":
|
|
339
|
-
return nominalPhraseHeadTraceFromHost(plan.realization.root.frame.host);
|
|
340
|
-
case "productiveAdjectivalSuffix":
|
|
341
|
-
return nominalPhraseHeadTraceFromHost(plan.realization.root.frame.host);
|
|
342
|
-
case "renyouNominalHead":
|
|
343
|
-
return null;
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
function nominalPhraseHeadTrace(plan) {
|
|
347
|
-
if (plan.realization.root.kind !== "nominalPhrase") {
|
|
348
|
-
return null;
|
|
349
|
-
}
|
|
350
|
-
return nominalPhraseHeadTraceFromHost(plan.realization.root);
|
|
351
|
-
}
|
|
352
|
-
function nominalPhraseHeadTraceFromHost(host) {
|
|
353
|
-
const hint = host.head.allomorphHint?.korean;
|
|
354
|
-
if (hint === undefined || hint.length === 0) {
|
|
355
|
-
return null;
|
|
356
|
-
}
|
|
357
|
-
return renderedTargetFromSegments([
|
|
358
|
-
syntheticTargetSegment({
|
|
359
|
-
text: hint,
|
|
360
|
-
sourceSpan: sourceSpanForRuntimeTokens(host.head.source?.tokens ?? [host.head.token]),
|
|
361
|
-
renderPlanKind: "headTailChain",
|
|
362
|
-
kind: "lexeme",
|
|
363
|
-
projectionConfidence: "semantic"
|
|
364
|
-
})
|
|
365
|
-
]);
|
|
366
|
-
}
|
|
367
|
-
function predicateNominalHostTrace(plan, options, numeric) {
|
|
368
|
-
const root = plan.realization.root;
|
|
369
|
-
if (root.kind !== "predicateNominalHost") {
|
|
370
|
-
return null;
|
|
371
|
-
}
|
|
372
|
-
const host = root.host;
|
|
373
|
-
const layout = predicateProjectionHostLayoutForTrace(plan);
|
|
374
|
-
const context = {
|
|
375
|
-
formal: options.formal ?? false,
|
|
376
|
-
outgoingBoundary: host.outgoingBoundary,
|
|
377
|
-
...(layout === undefined ? {} : { layout }),
|
|
378
|
-
lookups: options.lookups
|
|
379
|
-
};
|
|
380
|
-
const commitContext = clauseRoleCommitContext({
|
|
381
|
-
clauseRole: host,
|
|
382
|
-
root: host.root,
|
|
383
|
-
...(host.sourceTokens === undefined ? {} : { sourceTokens: host.sourceTokens }),
|
|
384
|
-
...(host.commitmentGrammar === undefined ? {} : { grammar: host.commitmentGrammar }),
|
|
385
|
-
...(layout === undefined ? {} : { layoutOverride: layout }),
|
|
386
|
-
lookups: options.lookups,
|
|
387
|
-
numeric
|
|
388
|
-
});
|
|
389
|
-
const committed = host.projection === "gerund_nominalizer"
|
|
390
|
-
? commitSharedTailParserGerundRoot({
|
|
391
|
-
root: host.root,
|
|
392
|
-
context,
|
|
393
|
-
commitContext,
|
|
394
|
-
fallbackHeadKind: "nominal"
|
|
395
|
-
})
|
|
396
|
-
: commitSharedTailParserRoot({
|
|
397
|
-
root: host.root,
|
|
398
|
-
context,
|
|
399
|
-
commitContext,
|
|
400
|
-
fallbackHeadKind: "nominal"
|
|
401
|
-
});
|
|
402
|
-
if ("ok" in committed) {
|
|
403
|
-
return null;
|
|
404
|
-
}
|
|
405
|
-
if (host.projection === "gerund_nominalizer") {
|
|
406
|
-
const traced = tracePredicateGerundProjectionHost(committed.committedTailRoot, committed.korean, options);
|
|
407
|
-
if (traced !== null) {
|
|
408
|
-
return traced;
|
|
409
|
-
}
|
|
410
|
-
return renderedTargetFromSegments([
|
|
411
|
-
syntheticTargetSegment({
|
|
412
|
-
text: committed.korean,
|
|
413
|
-
sourceSpan: sourceSpanForRuntimeTokens(host.source.tokens),
|
|
414
|
-
renderPlanKind: "headTailChain",
|
|
415
|
-
kind: "lexeme",
|
|
416
|
-
projectionConfidence: "semantic"
|
|
417
|
-
})
|
|
418
|
-
]);
|
|
419
|
-
}
|
|
420
|
-
if (committed.committedTailRoot === undefined) {
|
|
421
|
-
return null;
|
|
422
|
-
}
|
|
423
|
-
const traced = renderTailWithSourceTargetTrace(committed.committedTailRoot, {
|
|
424
|
-
formal: options.formal ?? false,
|
|
425
|
-
lookups: options.lookups
|
|
426
|
-
});
|
|
427
|
-
if (traced === null || traced.text !== committed.korean) {
|
|
428
|
-
return null;
|
|
429
|
-
}
|
|
430
|
-
if (host.projection !== "attributive_nominalizer" && host.projection !== "quoted_nominalizer") {
|
|
431
|
-
return traced;
|
|
432
|
-
}
|
|
433
|
-
return renderedTargetFromSegments([
|
|
434
|
-
...traced.segments,
|
|
435
|
-
syntheticTargetSegment({
|
|
436
|
-
text: " 것",
|
|
437
|
-
sourceSpan: sourceSpanForRuntimeTokens(root.nominalizer.source.tokens),
|
|
438
|
-
renderPlanKind: "headTailChain",
|
|
439
|
-
kind: "modal",
|
|
440
|
-
projectionConfidence: "owner"
|
|
441
|
-
})
|
|
442
|
-
]);
|
|
443
|
-
}
|
|
444
|
-
function tracePredicateGerundProjectionHost(root, renderedText, options) {
|
|
445
|
-
if (root === undefined || root.tail.kind !== "auxLayer") {
|
|
446
|
-
return null;
|
|
447
|
-
}
|
|
448
|
-
const baseTail = root.tail.terminal === "attributive"
|
|
449
|
-
? { ...root.tail, terminal: null }
|
|
450
|
-
: root.tail;
|
|
451
|
-
const projected = {
|
|
452
|
-
...root,
|
|
453
|
-
tail: {
|
|
454
|
-
...baseTail,
|
|
455
|
-
ops: [
|
|
456
|
-
...baseTail.ops,
|
|
457
|
-
buildPredicateGerundProjectionConnective()
|
|
458
|
-
]
|
|
459
|
-
},
|
|
460
|
-
sfp: null
|
|
461
|
-
};
|
|
462
|
-
const traced = renderTailWithSourceTargetTrace(projected, {
|
|
463
|
-
formal: options.formal ?? false,
|
|
464
|
-
lookups: options.lookups
|
|
465
|
-
});
|
|
466
|
-
return traced !== null && traced.text === renderedText ? traced : null;
|
|
467
|
-
}
|
|
468
|
-
function predicateProjectionHostLayoutForTrace(plan) {
|
|
469
|
-
if (plan.realization.root.kind !== "predicateNominalHost") {
|
|
470
|
-
return undefined;
|
|
471
|
-
}
|
|
472
|
-
const hostLayout = plan.realization.root.host.layout;
|
|
473
|
-
if (hostLayout !== undefined) {
|
|
474
|
-
return hostLayout;
|
|
475
|
-
}
|
|
476
|
-
const layout = plan.realization.commitContext?.layout;
|
|
477
|
-
if (layout !== undefined &&
|
|
478
|
-
typeof layout.ownerPredicateOfParticle === "function") {
|
|
479
|
-
return layout;
|
|
480
|
-
}
|
|
481
|
-
return undefined;
|
|
482
|
-
}
|
|
483
|
-
function nominalHeadTailRestSourceSpan(plan) {
|
|
484
|
-
switch (plan.realization.root.kind) {
|
|
485
|
-
case "predicateNominalHost":
|
|
486
|
-
return sourceSpanForRuntimeTokens(plan.realization.frame.source.tokens);
|
|
487
|
-
case "nominalPhrase":
|
|
488
|
-
return sourceSpanForRuntimeTokens(plan.realization.root.source.tokens.slice(1));
|
|
489
|
-
case "hostBearingLikeness":
|
|
490
|
-
return sourceSpanForRuntimeTokens(plan.realization.root.frame.source.tokens.slice(1));
|
|
491
|
-
case "productiveAdjectivalSuffix":
|
|
492
|
-
return sourceSpanForRuntimeTokens(plan.realization.root.frame.source.tokens.slice(1));
|
|
493
|
-
case "renyouNominalHead":
|
|
494
|
-
return sourceSpanForRuntimeTokens(plan.realization.root.source.tokens);
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
function nominalHeadTailRestSegmentKind(plan) {
|
|
498
|
-
if (plan.realization.root.kind === "productiveAdjectivalSuffix" || plan.realization.root.kind === "hostBearingLikeness") {
|
|
499
|
-
return "modal";
|
|
500
|
-
}
|
|
501
|
-
switch (plan.realization.frame.frameKind) {
|
|
502
|
-
case "lexical_particle":
|
|
503
|
-
case "definition_topic":
|
|
504
|
-
case "host_bearing_likeness":
|
|
505
|
-
case "productive_adjectival_suffix":
|
|
506
|
-
return "modal";
|
|
507
|
-
default:
|
|
508
|
-
return "connective";
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
function nominalHeadTailRestTraceSegments(plan, restText, formal) {
|
|
512
|
-
const negativeCopula = nominalHeadTailNegativeCopulaRestSegments(plan, restText, formal);
|
|
513
|
-
if (negativeCopula !== null) {
|
|
514
|
-
return negativeCopula;
|
|
515
|
-
}
|
|
516
|
-
return [
|
|
517
|
-
syntheticTargetSegment({
|
|
518
|
-
text: restText,
|
|
519
|
-
sourceSpan: nominalHeadTailRestSourceSpan(plan),
|
|
520
|
-
renderPlanKind: "headTailChain",
|
|
521
|
-
kind: nominalHeadTailRestSegmentKind(plan),
|
|
522
|
-
projectionConfidence: "owner"
|
|
523
|
-
})
|
|
524
|
-
];
|
|
525
|
-
}
|
|
526
|
-
function nominalHeadTailNegativeCopulaRestSegments(plan, restText, formal) {
|
|
527
|
-
const projection = plan.realization.frame.projection;
|
|
528
|
-
if (projection.kind !== "negativeCopulaPredicate") {
|
|
529
|
-
return null;
|
|
530
|
-
}
|
|
531
|
-
const terminal = renderAniTerminal({
|
|
532
|
-
formal,
|
|
533
|
-
polite: projection.polite,
|
|
534
|
-
past: projection.past
|
|
535
|
-
});
|
|
536
|
-
if (!restText.endsWith(terminal)) {
|
|
537
|
-
return null;
|
|
538
|
-
}
|
|
539
|
-
const prefix = restText.slice(0, -terminal.length);
|
|
540
|
-
if (prefix.length === 0) {
|
|
541
|
-
return null;
|
|
542
|
-
}
|
|
543
|
-
const source = nominalHeadTailNegativeCopulaSourceSplit(plan);
|
|
544
|
-
if (source === null) {
|
|
545
|
-
return null;
|
|
546
|
-
}
|
|
547
|
-
const trimmedPrefix = prefix.trimEnd();
|
|
548
|
-
if (trimmedPrefix.length === 0) {
|
|
549
|
-
return null;
|
|
550
|
-
}
|
|
551
|
-
const spacing = prefix.slice(trimmedPrefix.length);
|
|
552
|
-
const segments = [
|
|
553
|
-
syntheticTargetSegment({
|
|
554
|
-
text: trimmedPrefix,
|
|
555
|
-
sourceSpan: source.prefixSpan,
|
|
556
|
-
renderPlanKind: "headTailChain",
|
|
557
|
-
kind: nominalHeadTailRestSegmentKind(plan),
|
|
558
|
-
projectionConfidence: "owner"
|
|
559
|
-
})
|
|
560
|
-
];
|
|
561
|
-
if (spacing.length > 0) {
|
|
562
|
-
segments.push(syntheticTargetSegment({
|
|
563
|
-
text: spacing,
|
|
564
|
-
sourceSpan: null,
|
|
565
|
-
renderPlanKind: "headTailChain",
|
|
566
|
-
kind: "punctuation",
|
|
567
|
-
projectionConfidence: "owner"
|
|
568
|
-
}));
|
|
569
|
-
}
|
|
570
|
-
segments.push(...nominalHeadTailNegativeCopulaTerminalSegments(plan, terminal, source.negativeTokens));
|
|
571
|
-
return segments;
|
|
572
|
-
}
|
|
573
|
-
function nominalHeadTailNegativeCopulaSourceSplit(plan) {
|
|
574
|
-
const tokens = plan.realization.frame.source.tokens;
|
|
575
|
-
const projection = plan.realization.frame.projection;
|
|
576
|
-
if (projection.kind !== "negativeCopulaPredicate") {
|
|
577
|
-
return null;
|
|
578
|
-
}
|
|
579
|
-
const negativeStart = tokens.findIndex((token) => token.dictionaryForm === "ない" ||
|
|
580
|
-
token.surface === "ない" ||
|
|
581
|
-
token.surface === "ぬ" ||
|
|
582
|
-
token.surface === "ん" ||
|
|
583
|
-
token.surface.startsWith("なかっ") ||
|
|
584
|
-
(projection.polite && token.surface.startsWith("ませ")));
|
|
585
|
-
if (negativeStart < 0) {
|
|
586
|
-
return null;
|
|
587
|
-
}
|
|
588
|
-
return {
|
|
589
|
-
prefixSpan: sourceSpanForRuntimeTokens(tokens.slice(0, negativeStart)),
|
|
590
|
-
negativeTokens: tokens.slice(negativeStart)
|
|
591
|
-
};
|
|
592
|
-
}
|
|
593
|
-
function nominalHeadTailNegativeCopulaTerminalSegments(plan, terminal, sourceTokens) {
|
|
594
|
-
const split = nominalHeadTailNegativeCopulaTerminalSourceSplit(plan, terminal, sourceTokens);
|
|
595
|
-
if (split === null) {
|
|
596
|
-
return [
|
|
597
|
-
syntheticTargetSegment({
|
|
598
|
-
text: terminal,
|
|
599
|
-
sourceSpan: sourceSpanForRuntimeTokens(sourceTokens),
|
|
600
|
-
renderPlanKind: "headTailChain",
|
|
601
|
-
kind: "aux",
|
|
602
|
-
projectionConfidence: "semantic"
|
|
603
|
-
})
|
|
604
|
-
];
|
|
605
|
-
}
|
|
606
|
-
return [
|
|
607
|
-
syntheticTargetSegment({
|
|
608
|
-
text: split.negativeText,
|
|
609
|
-
sourceSpan: sourceSpanForRuntimeTokens(split.negativeTokens),
|
|
610
|
-
renderPlanKind: "headTailChain",
|
|
611
|
-
kind: "aux",
|
|
612
|
-
projectionConfidence: "semantic"
|
|
613
|
-
}),
|
|
614
|
-
syntheticTargetSegment({
|
|
615
|
-
text: split.tailText,
|
|
616
|
-
sourceSpan: sourceSpanForRuntimeTokens(split.tailTokens),
|
|
617
|
-
renderPlanKind: "headTailChain",
|
|
618
|
-
kind: "aux",
|
|
619
|
-
projectionConfidence: "semantic"
|
|
620
|
-
})
|
|
621
|
-
];
|
|
622
|
-
}
|
|
623
|
-
function nominalHeadTailNegativeCopulaTerminalSourceSplit(plan, terminal, sourceTokens) {
|
|
624
|
-
const projection = plan.realization.frame.projection;
|
|
625
|
-
if (projection.kind !== "negativeCopulaPredicate" || !projection.past || !terminal.startsWith("아니")) {
|
|
626
|
-
return null;
|
|
627
|
-
}
|
|
628
|
-
const tailText = terminal.slice("아니".length);
|
|
629
|
-
if (tailText.length === 0) {
|
|
630
|
-
return null;
|
|
631
|
-
}
|
|
632
|
-
const tailStart = nominalHeadTailNegativeCopulaPastSourceStart(sourceTokens, projection.polite);
|
|
633
|
-
if (tailStart <= 0 || tailStart >= sourceTokens.length) {
|
|
634
|
-
return null;
|
|
635
|
-
}
|
|
636
|
-
return {
|
|
637
|
-
negativeText: "아니",
|
|
638
|
-
tailText,
|
|
639
|
-
negativeTokens: sourceTokens.slice(0, tailStart),
|
|
640
|
-
tailTokens: sourceTokens.slice(tailStart)
|
|
641
|
-
};
|
|
642
|
-
}
|
|
643
|
-
function nominalHeadTailNegativeCopulaPastSourceStart(tokens, polite) {
|
|
644
|
-
if (polite) {
|
|
645
|
-
const desuIndex = tokens.findIndex((token) => token.dictionaryForm === "です" ||
|
|
646
|
-
token.surface === "でし" ||
|
|
647
|
-
token.surface.startsWith("でし"));
|
|
648
|
-
if (desuIndex >= 0) {
|
|
649
|
-
return desuIndex;
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
return tokens.findIndex((token) => token.dictionaryForm === "た" ||
|
|
653
|
-
token.surface === "た");
|
|
654
|
-
}
|
|
655
322
|
function realizeLemmaWithTrace(plan, options) {
|
|
656
323
|
const expected = realizeLemma(plan, options.formal ?? false, options.lookups, options);
|
|
657
324
|
const imperative = realizeImperativeLemmaWithTrace(plan, expected, options);
|
|
@@ -902,18 +569,6 @@ function realizeAttributiveWithTrace(plan, options) {
|
|
|
902
569
|
const sourceSpan = combineSourceSpans(sourceSpanForRuntimeTokens([plan.contentToken]), sourceSpanForRuntimeTokens(plan.auxTokens)) ?? options.sourceSpan ?? null;
|
|
903
570
|
return attachUnitToRenderedTarget(semanticRenderedTargetSegment(plan.kind, expected, sourceSpan, "lexeme"), options.unit ?? null);
|
|
904
571
|
}
|
|
905
|
-
function attachUnitToRenderedTarget(rendered, unit) {
|
|
906
|
-
if (unit === null) {
|
|
907
|
-
return rendered;
|
|
908
|
-
}
|
|
909
|
-
return {
|
|
910
|
-
text: rendered.text,
|
|
911
|
-
segments: rendered.segments.map((segment) => ({
|
|
912
|
-
...segment,
|
|
913
|
-
unit: segment.unit ?? unit
|
|
914
|
-
}))
|
|
915
|
-
};
|
|
916
|
-
}
|
|
917
572
|
function traceWithCommittedTailSuffix(traced, committedText) {
|
|
918
573
|
if (traced === null || !committedText.startsWith(traced.text)) {
|
|
919
574
|
return null;
|
|
@@ -1604,17 +1259,6 @@ function exactChildTrace(plan, options) {
|
|
|
1604
1259
|
unit: options.unit ?? null
|
|
1605
1260
|
});
|
|
1606
1261
|
}
|
|
1607
|
-
function semanticRenderedTargetSegment(renderPlanKind, text, sourceSpan, kind, projectionConfidence = "semantic") {
|
|
1608
|
-
return renderedTargetFromSegments([
|
|
1609
|
-
syntheticTargetSegment({
|
|
1610
|
-
text,
|
|
1611
|
-
sourceSpan,
|
|
1612
|
-
renderPlanKind,
|
|
1613
|
-
kind,
|
|
1614
|
-
projectionConfidence
|
|
1615
|
-
})
|
|
1616
|
-
]);
|
|
1617
|
-
}
|
|
1618
1262
|
function predicatePayloadSourceSpan(payload) {
|
|
1619
1263
|
return combineSourceSpans(sourceSpanForRuntimeTokens([payload.contentToken]), sourceSpanForRuntimeTokens(payload.auxTokens));
|
|
1620
1264
|
}
|
|
@@ -1688,17 +1332,6 @@ function realizeReasonBecauseWithTrace(plan, options) {
|
|
|
1688
1332
|
semanticRenderedTargetSegment(plan.kind, stem, combineSourceSpans(sourceSpanForRuntimeTokens(payload.auxTokens), options.sourceSpan ?? null), "lexeme")
|
|
1689
1333
|
], "connective");
|
|
1690
1334
|
}
|
|
1691
|
-
function appendOwnerTemplateText(segments, renderPlanKind, text, kind) {
|
|
1692
|
-
if (text.length === 0) {
|
|
1693
|
-
return;
|
|
1694
|
-
}
|
|
1695
|
-
segments.push(syntheticTargetSegment({
|
|
1696
|
-
text,
|
|
1697
|
-
renderPlanKind,
|
|
1698
|
-
kind: /^\s+$/u.test(text) ? "punctuation" : kind,
|
|
1699
|
-
projectionConfidence: "owner"
|
|
1700
|
-
}));
|
|
1701
|
-
}
|
|
1702
1335
|
function semanticRenderedTargetSegmentWithTrailingSpaceSplit(renderPlanKind, text, sourceSpan, kind, projectionConfidence = "semantic") {
|
|
1703
1336
|
const trailingSpace = /\s+$/u.exec(text)?.[0] ?? "";
|
|
1704
1337
|
if (trailingSpace.length === 0 || trailingSpace.length === text.length) {
|
|
@@ -1831,237 +1464,9 @@ function realizePredicateScopeCarrierWithTrace(plan, options) {
|
|
|
1831
1464
|
? withSuffix
|
|
1832
1465
|
: fallbackRenderedTarget(plan, options);
|
|
1833
1466
|
}
|
|
1834
|
-
function appendRenderedTarget(base, suffix) {
|
|
1835
|
-
return renderedTargetFromSegments([...base.segments, ...suffix.segments]);
|
|
1836
|
-
}
|
|
1837
|
-
function appendOwnerSuffixTrace(renderPlanKind, base, suffix, kind) {
|
|
1838
|
-
if (suffix.length === 0) {
|
|
1839
|
-
return base;
|
|
1840
|
-
}
|
|
1841
|
-
return renderedTargetFromSegments([
|
|
1842
|
-
...base.segments,
|
|
1843
|
-
syntheticTargetSegment({
|
|
1844
|
-
text: suffix,
|
|
1845
|
-
renderPlanKind,
|
|
1846
|
-
kind,
|
|
1847
|
-
projectionConfidence: "owner"
|
|
1848
|
-
})
|
|
1849
|
-
]);
|
|
1850
|
-
}
|
|
1851
|
-
function trimRenderedTargetSuffix(rendered, suffix) {
|
|
1852
|
-
if (suffix.length === 0 || !rendered.text.endsWith(suffix) || rendered.segments.length === 0) {
|
|
1853
|
-
return null;
|
|
1854
|
-
}
|
|
1855
|
-
const segments = rendered.segments.slice();
|
|
1856
|
-
let remaining = suffix.length;
|
|
1857
|
-
while (remaining > 0 && segments.length > 0) {
|
|
1858
|
-
const last = segments[segments.length - 1];
|
|
1859
|
-
if (last.text.length > remaining) {
|
|
1860
|
-
segments[segments.length - 1] = {
|
|
1861
|
-
...last,
|
|
1862
|
-
text: last.text.slice(0, last.text.length - remaining)
|
|
1863
|
-
};
|
|
1864
|
-
remaining = 0;
|
|
1865
|
-
break;
|
|
1866
|
-
}
|
|
1867
|
-
remaining -= last.text.length;
|
|
1868
|
-
segments.pop();
|
|
1869
|
-
}
|
|
1870
|
-
return remaining === 0 ? renderedTargetFromSegments(segments) : null;
|
|
1871
|
-
}
|
|
1872
|
-
function renderedTargetFromSegments(segments) {
|
|
1873
|
-
return {
|
|
1874
|
-
text: renderedTargetText(segments),
|
|
1875
|
-
segments,
|
|
1876
|
-
};
|
|
1877
|
-
}
|
|
1878
|
-
function renderedTargetText(segments) {
|
|
1879
|
-
return segments.map((segment) => segment.text).join("");
|
|
1880
|
-
}
|
|
1881
|
-
function nonIdentityAllomorphHost(surface, host) {
|
|
1882
|
-
return host === surface ? undefined : host;
|
|
1883
|
-
}
|
|
1884
|
-
function allomorphHostOfRenderedTarget(target, options) {
|
|
1885
|
-
const host = trailingAllomorphHostText(target.segments, options.tokens === undefined ? {} : { tokens: options.tokens });
|
|
1886
|
-
return host.length > 0 ? host : target.text;
|
|
1887
|
-
}
|
|
1888
|
-
function withFusedParticleSourceSpan(target, source) {
|
|
1889
|
-
const particleSpan = source?.sourceSpan ?? null;
|
|
1890
|
-
if (particleSpan === null || target.segments.length === 0) {
|
|
1891
|
-
return target;
|
|
1892
|
-
}
|
|
1893
|
-
const lastIndex = target.segments.length - 1;
|
|
1894
|
-
const last = target.segments[lastIndex];
|
|
1895
|
-
const combined = combineSourceSpans(last.sourceSpan, particleSpan);
|
|
1896
|
-
return {
|
|
1897
|
-
text: target.text,
|
|
1898
|
-
segments: [
|
|
1899
|
-
...target.segments.slice(0, lastIndex),
|
|
1900
|
-
{
|
|
1901
|
-
...last,
|
|
1902
|
-
sourceSpan: combined,
|
|
1903
|
-
boundaryBefore: sourceBoundaryBefore(combined),
|
|
1904
|
-
boundaryAfter: sourceBoundaryAfter(combined)
|
|
1905
|
-
}
|
|
1906
|
-
]
|
|
1907
|
-
};
|
|
1908
|
-
}
|
|
1909
|
-
function withParticleSourceProvenance(segment, source) {
|
|
1910
|
-
if (source === undefined) {
|
|
1911
|
-
return segment;
|
|
1912
|
-
}
|
|
1913
|
-
const sourceSpan = source.sourceSpan ?? null;
|
|
1914
|
-
return {
|
|
1915
|
-
...segment,
|
|
1916
|
-
sourceSpan,
|
|
1917
|
-
boundaryBefore: sourceBoundaryBefore(sourceSpan),
|
|
1918
|
-
boundaryAfter: sourceBoundaryAfter(sourceSpan),
|
|
1919
|
-
unit: source.unit ?? segment.unit
|
|
1920
|
-
};
|
|
1921
|
-
}
|
|
1922
|
-
function syntheticTargetSegment(options) {
|
|
1923
|
-
const sourceSpan = options.sourceSpan ?? null;
|
|
1924
|
-
const allomorphRole = options.allomorphRole ?? (options.kind === "punctuation" ||
|
|
1925
|
-
options.kind === "quote" ||
|
|
1926
|
-
options.kind === "parenthetical" ||
|
|
1927
|
-
options.kind === "annotation" ||
|
|
1928
|
-
options.kind === "fallback" ||
|
|
1929
|
-
sourceSpan === null
|
|
1930
|
-
? undefined
|
|
1931
|
-
: "source_anchor");
|
|
1932
|
-
return {
|
|
1933
|
-
text: options.text,
|
|
1934
|
-
sourceSpan,
|
|
1935
|
-
boundaryBefore: sourceBoundaryBefore(sourceSpan),
|
|
1936
|
-
boundaryAfter: sourceBoundaryAfter(sourceSpan),
|
|
1937
|
-
unit: null,
|
|
1938
|
-
renderPlanKind: options.renderPlanKind,
|
|
1939
|
-
kind: options.kind,
|
|
1940
|
-
...(allomorphRole === undefined ? {} : { allomorphRole }),
|
|
1941
|
-
projectionConfidence: options.projectionConfidence ?? "exact",
|
|
1942
|
-
};
|
|
1943
|
-
}
|
|
1944
|
-
function sourceSpanForRuntimeTokens(tokens) {
|
|
1945
|
-
let startOrdinal = null;
|
|
1946
|
-
let endOrdinal = null;
|
|
1947
|
-
for (const token of tokens) {
|
|
1948
|
-
const span = token.sourceSpan ?? (token.sourceOrdinal === undefined ? null : {
|
|
1949
|
-
startOrdinal: token.sourceOrdinal,
|
|
1950
|
-
endOrdinal: token.sourceOrdinal + 1,
|
|
1951
|
-
});
|
|
1952
|
-
if (span === null) {
|
|
1953
|
-
continue;
|
|
1954
|
-
}
|
|
1955
|
-
startOrdinal = startOrdinal === null ? span.startOrdinal : Math.min(startOrdinal, span.startOrdinal);
|
|
1956
|
-
endOrdinal = endOrdinal === null ? span.endOrdinal : Math.max(endOrdinal, span.endOrdinal);
|
|
1957
|
-
}
|
|
1958
|
-
return startOrdinal === null || endOrdinal === null
|
|
1959
|
-
? null
|
|
1960
|
-
: { startOrdinal, endOrdinal };
|
|
1961
|
-
}
|
|
1962
|
-
function sourceSpanForRuntimeTokenIndexes(tokens, indexes) {
|
|
1963
|
-
return sourceSpanForRuntimeTokens(indexes
|
|
1964
|
-
.map((index) => tokens[index])
|
|
1965
|
-
.filter((token) => token !== undefined));
|
|
1966
|
-
}
|
|
1967
|
-
function combineSourceSpans(...spans) {
|
|
1968
|
-
let startOrdinal = null;
|
|
1969
|
-
let endOrdinal = null;
|
|
1970
|
-
for (const span of spans) {
|
|
1971
|
-
if (span === null) {
|
|
1972
|
-
continue;
|
|
1973
|
-
}
|
|
1974
|
-
startOrdinal = startOrdinal === null ? span.startOrdinal : Math.min(startOrdinal, span.startOrdinal);
|
|
1975
|
-
endOrdinal = endOrdinal === null ? span.endOrdinal : Math.max(endOrdinal, span.endOrdinal);
|
|
1976
|
-
}
|
|
1977
|
-
return startOrdinal === null || endOrdinal === null
|
|
1978
|
-
? null
|
|
1979
|
-
: { startOrdinal, endOrdinal };
|
|
1980
|
-
}
|
|
1981
|
-
function renderPlanTargetSegmentKind(plan) {
|
|
1982
|
-
switch (plan.kind) {
|
|
1983
|
-
case "fixedText":
|
|
1984
|
-
case "registerText":
|
|
1985
|
-
case "numeral":
|
|
1986
|
-
case "lemma":
|
|
1987
|
-
case "attributive":
|
|
1988
|
-
case "conjugatedLemma":
|
|
1989
|
-
case "particleizedLemma":
|
|
1990
|
-
case "particleizedContent":
|
|
1991
|
-
case "compoundNominalSuffix":
|
|
1992
|
-
case "semanticCarrierPredicate":
|
|
1993
|
-
case "keijoujiAdverb":
|
|
1994
|
-
case "keijoujiState":
|
|
1995
|
-
return "lexeme";
|
|
1996
|
-
case "lexicalParticleAdverbial":
|
|
1997
|
-
return "connective";
|
|
1998
|
-
case "structuralRelationSequence":
|
|
1999
|
-
return "quote";
|
|
2000
|
-
case "copulaPredicate":
|
|
2001
|
-
return "aux";
|
|
2002
|
-
case "headTailChain":
|
|
2003
|
-
case "hybridPostAux":
|
|
2004
|
-
case "functionalChainResidual":
|
|
2005
|
-
case "noda":
|
|
2006
|
-
return "modal";
|
|
2007
|
-
case "discourseConnective":
|
|
2008
|
-
case "reasonBecause":
|
|
2009
|
-
case "nominalConnectiveScope":
|
|
2010
|
-
return "connective";
|
|
2011
|
-
case "quoteHostReportingPassive":
|
|
2012
|
-
case "quoteCognitionHost":
|
|
2013
|
-
case "conjectureThoughtQuote":
|
|
2014
|
-
return "quote";
|
|
2015
|
-
case "kaParallel":
|
|
2016
|
-
case "kaParallelNegativeAlternative":
|
|
2017
|
-
case "nariParallel":
|
|
2018
|
-
case "predicateScope":
|
|
2019
|
-
case "predicateNominalScope":
|
|
2020
|
-
case "predicateScopeCarrier":
|
|
2021
|
-
case "pronominalNoNominal":
|
|
2022
|
-
case "youdaModality":
|
|
2023
|
-
case "nominalDemoAru":
|
|
2024
|
-
case "giveRequest":
|
|
2025
|
-
case "wakeExplanation":
|
|
2026
|
-
return "synthetic";
|
|
2027
|
-
case "legacySurfaceComposition":
|
|
2028
|
-
return "fallback";
|
|
2029
|
-
}
|
|
2030
|
-
return assertNeverSegmentKind(plan);
|
|
2031
|
-
}
|
|
2032
|
-
function renderPlanProjectionConfidence(plan) {
|
|
2033
|
-
if (plan.kind === "fixedText" || plan.kind === "registerText" || plan.kind === "numeral") {
|
|
2034
|
-
return "exact";
|
|
2035
|
-
}
|
|
2036
|
-
if (plan.kind === "legacySurfaceComposition") {
|
|
2037
|
-
return "fallback";
|
|
2038
|
-
}
|
|
2039
|
-
return "owner";
|
|
2040
|
-
}
|
|
2041
|
-
function sourceBoundaryBefore(sourceSpan) {
|
|
2042
|
-
if (sourceSpan === null) {
|
|
2043
|
-
return null;
|
|
2044
|
-
}
|
|
2045
|
-
return {
|
|
2046
|
-
beforeOrdinal: sourceSpan.startOrdinal > 0 ? sourceSpan.startOrdinal - 1 : null,
|
|
2047
|
-
afterOrdinal: sourceSpan.startOrdinal
|
|
2048
|
-
};
|
|
2049
|
-
}
|
|
2050
|
-
function sourceBoundaryAfter(sourceSpan) {
|
|
2051
|
-
if (sourceSpan === null) {
|
|
2052
|
-
return null;
|
|
2053
|
-
}
|
|
2054
|
-
return {
|
|
2055
|
-
beforeOrdinal: sourceSpan.endOrdinal - 1,
|
|
2056
|
-
afterOrdinal: sourceSpan.endOrdinal
|
|
2057
|
-
};
|
|
2058
|
-
}
|
|
2059
1467
|
function assertNeverRenderPlan(plan) {
|
|
2060
1468
|
throw new Error(`unhandled render plan kind in traced renderer: ${plan.kind}`);
|
|
2061
1469
|
}
|
|
2062
|
-
function assertNeverSegmentKind(plan) {
|
|
2063
|
-
throw new Error(`unhandled render plan kind in segment classifier: ${plan.kind}`);
|
|
2064
|
-
}
|
|
2065
1470
|
function realizeKaParallel(plan, formal, lookups, numeric, tokens) {
|
|
2066
1471
|
const renderOptions = {
|
|
2067
1472
|
formal,
|
|
@@ -2166,20 +1571,6 @@ function kaParallelChoiceSuffix(host, formal, terminalPunctuation) {
|
|
|
2166
1571
|
}
|
|
2167
1572
|
return "인지";
|
|
2168
1573
|
}
|
|
2169
|
-
function realizeFunctionalChainResidual(plan, formal, lookups) {
|
|
2170
|
-
return renderRepeatedFunctionalChainText({
|
|
2171
|
-
koreanLemma: plan.koreanLemma,
|
|
2172
|
-
irregular: plan.irregular,
|
|
2173
|
-
koreanPos: plan.koreanPos,
|
|
2174
|
-
chunks: plan.chunks,
|
|
2175
|
-
formal,
|
|
2176
|
-
question: plan.question,
|
|
2177
|
-
...(plan.jpDictForm === undefined || plan.jpDictForm === null ? {} : { jpDictForm: plan.jpDictForm }),
|
|
2178
|
-
...(plan.verbConjType === undefined || plan.verbConjType === null ? {} : { verbConjType: plan.verbConjType }),
|
|
2179
|
-
forcePassive: plan.forcePassive === true,
|
|
2180
|
-
lookups
|
|
2181
|
-
});
|
|
2182
|
-
}
|
|
2183
1574
|
function discourseConnectivePayload(plan) {
|
|
2184
1575
|
return "payload" in plan ? plan.payload : plan;
|
|
2185
1576
|
}
|
|
@@ -2255,283 +1646,60 @@ function sharedRenderSourceFromPlan(plan) {
|
|
|
2255
1646
|
if (plan.kind === "headTailChain") {
|
|
2256
1647
|
return {
|
|
2257
1648
|
descriptor: plan.headTailCandidate,
|
|
2258
|
-
sourceCandidate: plan.headTailSourceCandidate
|
|
2259
|
-
};
|
|
2260
|
-
}
|
|
2261
|
-
if (plan.kind === "legacySurfaceComposition") {
|
|
2262
|
-
const suffix = wideScopeNegativeSurfaceSuffix(plan);
|
|
2263
|
-
if (isRenderPlan(suffix)) {
|
|
2264
|
-
const suffixSource = sharedRenderSourceFromPlan(suffix);
|
|
2265
|
-
if (suffixSource.descriptor !== undefined || suffixSource.sourceCandidate !== undefined) {
|
|
2266
|
-
return suffixSource;
|
|
2267
|
-
}
|
|
2268
|
-
}
|
|
2269
|
-
if (isRenderPlan(plan.prefix)) {
|
|
2270
|
-
return sharedRenderSourceFromPlan(plan.prefix);
|
|
2271
|
-
}
|
|
2272
|
-
}
|
|
2273
|
-
return { descriptor: undefined, sourceCandidate: undefined };
|
|
2274
|
-
}
|
|
2275
|
-
function sharedRenderFallbackHeadKind(plan) {
|
|
2276
|
-
switch (plan.kind) {
|
|
2277
|
-
case "headTailChain":
|
|
2278
|
-
if (plan.realization.kind === "nominal") {
|
|
2279
|
-
return plan.realization.root.kind === "predicateNominalHost" ? "predicate_nominalized" : "nominal";
|
|
2280
|
-
}
|
|
2281
|
-
return "predicate";
|
|
2282
|
-
case "lemma":
|
|
2283
|
-
case "predicateScope":
|
|
2284
|
-
case "predicateNominalScope":
|
|
2285
|
-
return "predicate";
|
|
2286
|
-
default:
|
|
2287
|
-
return "unknown";
|
|
2288
|
-
}
|
|
2289
|
-
}
|
|
2290
|
-
function realizeConjugatedLemma(plan, lookups) {
|
|
2291
|
-
if (plan.adverbial !== undefined && (plan.auxTokens === undefined || plan.auxTokens.length === 0) && plan.voice !== "potential" && plan.voice !== "passive") {
|
|
2292
|
-
return `${plan.prefix ?? ""}${plan.adverbial}${plan.particle === undefined ? "" : selectParticle(plan.adverbial, plan.particle)}${plan.suffix ?? ""}`;
|
|
2293
|
-
}
|
|
2294
|
-
let base;
|
|
2295
|
-
if (plan.auxTokens !== undefined && plan.auxTokens.length > 0) {
|
|
2296
|
-
base = plan.voice === "potential"
|
|
2297
|
-
? resolvePotentialChainConnective(plan.koreanLemma, asIrregular(plan.irregular), koreanPredicateAuxChain(plan.auxTokens), plan.ending, {}, lookups)
|
|
2298
|
-
: renderKoreanPredicateConnective(plan.koreanLemma, asIrregular(plan.irregular), plan.koreanPos, koreanPredicateAuxChain(plan.auxTokens), plan.ending, {
|
|
2299
|
-
lookups,
|
|
2300
|
-
...(plan.jpDictForm === undefined || plan.jpDictForm === null ? {} : { jpDictForm: plan.jpDictForm }),
|
|
2301
|
-
...(plan.verbConjType === undefined || plan.verbConjType === null ? {} : { verbConjType: plan.verbConjType }),
|
|
2302
|
-
forcePassive: plan.voice === "passive"
|
|
2303
|
-
});
|
|
2304
|
-
}
|
|
2305
|
-
else if (plan.voice === "potential") {
|
|
2306
|
-
base = resolvePotentialChainConnective(plan.koreanLemma, asIrregular(plan.irregular), koreanPredicateAuxChain([]), plan.ending, {}, lookups);
|
|
2307
|
-
}
|
|
2308
|
-
else {
|
|
2309
|
-
base = conjugate(plan.koreanLemma, asIrregular(plan.irregular), plan.ending);
|
|
2310
|
-
}
|
|
2311
|
-
return `${plan.prefix ?? ""}${base}${plan.particle === undefined ? "" : selectParticle(base, plan.particle)}${plan.suffix ?? ""}`;
|
|
2312
|
-
}
|
|
2313
|
-
function replacedStemDerivation(derivation, incoming, options) {
|
|
2314
|
-
if (derivation === undefined) {
|
|
2315
|
-
return { stem: incoming };
|
|
2316
|
-
}
|
|
2317
|
-
const rederived = rederiveStemDerivation(derivation, incoming, options);
|
|
2318
|
-
return rederived === null
|
|
2319
|
-
? { stem: incoming }
|
|
2320
|
-
: { stem: rederived.stem, ...(rederived.derivation === undefined ? {} : { derivation: rederived.derivation }) };
|
|
2321
|
-
}
|
|
2322
|
-
function withReplacedStemDerivation(plan, derivation) {
|
|
2323
|
-
if (derivation !== undefined) {
|
|
2324
|
-
return { ...plan, stemDerivation: derivation };
|
|
2325
|
-
}
|
|
2326
|
-
const { stemDerivation: _dropped, ...rest } = plan;
|
|
2327
|
-
return rest;
|
|
2328
|
-
}
|
|
2329
|
-
function shouldDropLongNegativeOp(auxTokens, options) {
|
|
2330
|
-
return options.dropFirstNegativeAux === true && !auxTokens.some(isNegativeAuxToken);
|
|
2331
|
-
}
|
|
2332
|
-
export function replaceLemmaRenderPlan(plan, options) {
|
|
2333
|
-
const koreanLemma = options.koreanLemma;
|
|
2334
|
-
const koreanPos = options.koreanPos ?? undefined;
|
|
2335
|
-
const stripOptions = {
|
|
2336
|
-
dropFirstPassiveAux: options.dropFirstPassiveAux ?? false,
|
|
2337
|
-
dropFirstCausativeAux: options.dropFirstCausativeAux ?? false,
|
|
2338
|
-
dropFirstNegativeAux: options.dropFirstNegativeAux ?? false
|
|
2339
|
-
};
|
|
2340
|
-
if (plan.kind === "fixedText" && plan.fusedFromLemma === true) {
|
|
2341
|
-
return { kind: "fixedText", text: koreanLemma, koreanPos: koreanPos ?? plan.koreanPos ?? null };
|
|
2342
|
-
}
|
|
2343
|
-
if (plan.kind === "lemma") {
|
|
2344
|
-
const planAuxTokens = auxTokensOf(plan);
|
|
2345
|
-
const auxTokens = rewriteAuxTokens(planAuxTokens, stripOptions);
|
|
2346
|
-
const derived = replacedStemDerivation(plan.stemDerivation, {
|
|
2347
|
-
koreanLemma,
|
|
2348
|
-
irregular: options.irregular,
|
|
2349
|
-
koreanPos: koreanPos ?? plan.koreanPos
|
|
2350
|
-
}, { dropLongNegativeOp: shouldDropLongNegativeOp(planAuxTokens, options) });
|
|
2351
|
-
return withReplacedStemDerivation({
|
|
2352
|
-
...plan,
|
|
2353
|
-
koreanLemma: derived.stem.koreanLemma,
|
|
2354
|
-
koreanPos: derived.stem.koreanPos,
|
|
2355
|
-
irregular: derived.stem.irregular,
|
|
2356
|
-
auxTokens,
|
|
2357
|
-
voice: "active"
|
|
2358
|
-
}, derived.derivation);
|
|
2359
|
-
}
|
|
2360
|
-
if (plan.kind === "copulaPredicate") {
|
|
2361
|
-
if (typeof plan.koreanLemma !== "string") {
|
|
2362
|
-
return plan;
|
|
2363
|
-
}
|
|
2364
|
-
const copulaAdj = resolveCopulaAdj(plan.entry ?? null, koreanLemma, koreanPos ?? 명사, options.irregular, plan.jpPos ?? null);
|
|
2365
|
-
return {
|
|
2366
|
-
...plan,
|
|
2367
|
-
koreanLemma: copulaAdj[0],
|
|
2368
|
-
irregular: asIrregular(copulaAdj[2]) ?? null
|
|
2369
|
-
};
|
|
2370
|
-
}
|
|
2371
|
-
if (plan.kind === "particleizedLemma" && "koreanLemma" in plan && "koreanPos" in plan) {
|
|
2372
|
-
return {
|
|
2373
|
-
...plan,
|
|
2374
|
-
koreanLemma,
|
|
2375
|
-
koreanPos: koreanPos ?? plan.koreanPos,
|
|
2376
|
-
irregular: options.irregular
|
|
2377
|
-
};
|
|
2378
|
-
}
|
|
2379
|
-
if (plan.kind === "attributive") {
|
|
2380
|
-
const planAuxTokens = auxTokensOf(plan);
|
|
2381
|
-
const [auxTokens, replacementToken] = rewriteAuxTokensWithReplacement(planAuxTokens, stripOptions);
|
|
2382
|
-
const derived = replacedStemDerivation(plan.stemDerivation, {
|
|
2383
|
-
koreanLemma,
|
|
2384
|
-
irregular: options.irregular,
|
|
2385
|
-
koreanPos: koreanPos ?? plan.koreanPos
|
|
2386
|
-
}, { dropLongNegativeOp: shouldDropLongNegativeOp(planAuxTokens, options) });
|
|
2387
|
-
const nominalEvidence = plan.nominalAttributiveEvidence === "teki_derivation"
|
|
2388
|
-
? { nominalAttributiveEvidence: "teki_derivation" }
|
|
2389
|
-
: {};
|
|
2390
|
-
const { nominalAttributiveEvidence: _staleNominalEvidence, ...withoutNominalEvidence } = plan;
|
|
2391
|
-
return withReplacedStemDerivation({
|
|
2392
|
-
...withoutNominalEvidence,
|
|
2393
|
-
...nominalEvidence,
|
|
2394
|
-
koreanLemma: derived.stem.koreanLemma,
|
|
2395
|
-
koreanPos: derived.stem.koreanPos,
|
|
2396
|
-
irregular: derived.stem.irregular,
|
|
2397
|
-
auxTokens,
|
|
2398
|
-
contentToken: replacementToken ?? plan.contentToken,
|
|
2399
|
-
voice: "active"
|
|
2400
|
-
}, derived.derivation);
|
|
2401
|
-
}
|
|
2402
|
-
if (plan.kind === "conjugatedLemma" && "koreanLemma" in plan && "koreanPos" in plan && "ending" in plan) {
|
|
2403
|
-
const auxTokens = rewriteAuxTokens(plan.auxTokens ?? [], stripOptions);
|
|
2404
|
-
return {
|
|
2405
|
-
...plan,
|
|
2406
|
-
koreanLemma,
|
|
2407
|
-
koreanPos: koreanPos ?? plan.koreanPos,
|
|
2408
|
-
irregular: options.irregular,
|
|
2409
|
-
auxTokens,
|
|
2410
|
-
voice: "active"
|
|
2411
|
-
};
|
|
2412
|
-
}
|
|
2413
|
-
if (plan.kind === "legacySurfaceComposition") {
|
|
2414
|
-
const rewritePrefix = shouldRewriteSurfacePrefixOnLemma(plan);
|
|
2415
|
-
const rewriteSuffix = shouldRewriteSurfaceSuffixOnLemma(plan);
|
|
2416
|
-
const prefix = rewritePrefix && isRenderPlan(plan.prefix)
|
|
2417
|
-
? replaceLemmaRenderPlan(plan.prefix, options)
|
|
2418
|
-
: plan.prefix;
|
|
2419
|
-
if (prefix === undefined && rewritePrefix && isRenderPlan(plan.prefix)) {
|
|
2420
|
-
return undefined;
|
|
2421
|
-
}
|
|
2422
|
-
const suffix = rewriteSuffix && isRenderPlan(plan.suffix)
|
|
2423
|
-
? replaceLemmaRenderPlan(plan.suffix, options)
|
|
2424
|
-
: plan.suffix;
|
|
2425
|
-
if (suffix === undefined && rewriteSuffix && isRenderPlan(plan.suffix)) {
|
|
2426
|
-
return undefined;
|
|
2427
|
-
}
|
|
2428
|
-
return {
|
|
2429
|
-
...plan,
|
|
2430
|
-
...(prefix === undefined ? {} : { prefix }),
|
|
2431
|
-
...(suffix === undefined ? {} : { suffix })
|
|
2432
|
-
};
|
|
2433
|
-
}
|
|
2434
|
-
if (plan.kind === "predicateScope") {
|
|
2435
|
-
const base = replaceLemmaRenderPlan(plan.base, options);
|
|
2436
|
-
return base === undefined ? undefined : { ...plan, base };
|
|
2437
|
-
}
|
|
2438
|
-
if (plan.kind === "noda") {
|
|
2439
|
-
if (!isRenderPlan(plan.prefix)) {
|
|
2440
|
-
return undefined;
|
|
2441
|
-
}
|
|
2442
|
-
const prefix = replaceLemmaRenderPlan(plan.prefix, options);
|
|
2443
|
-
return prefix === undefined ? undefined : { ...plan, prefix };
|
|
2444
|
-
}
|
|
2445
|
-
if (plan.kind === "giveRequest") {
|
|
2446
|
-
const base = replaceLemmaRenderPlan(plan.base, options);
|
|
2447
|
-
return base === undefined ? undefined : { ...plan, base, koreanLemma };
|
|
2448
|
-
}
|
|
2449
|
-
if (plan.kind === "youdaModality") {
|
|
2450
|
-
return rewriteSimilePredicatePayloadLemma(plan, options, stripOptions);
|
|
2451
|
-
}
|
|
2452
|
-
if (plan.kind === "nominalConnectiveScope") {
|
|
2453
|
-
const payload = nominalConnectiveScopePayload(plan);
|
|
2454
|
-
const content = replaceLemmaRenderPlan(payload.content, options);
|
|
2455
|
-
return content === undefined ? undefined : { kind: "nominalConnectiveScope", payload: { ...payload, content } };
|
|
2456
|
-
}
|
|
2457
|
-
if (plan.kind === "nominalDemoAru") {
|
|
2458
|
-
const payload = nominalDemoAruPayload(plan);
|
|
2459
|
-
const content = replaceLemmaRenderPlan(payload.content, options);
|
|
2460
|
-
return content === undefined ? undefined : { kind: "nominalDemoAru", payload: { ...payload, content } };
|
|
2461
|
-
}
|
|
2462
|
-
if (plan.kind === "reasonBecause") {
|
|
2463
|
-
const payload = reasonBecausePayload(plan);
|
|
2464
|
-
return {
|
|
2465
|
-
kind: "reasonBecause",
|
|
2466
|
-
payload: {
|
|
2467
|
-
...payload,
|
|
2468
|
-
koreanLemma,
|
|
2469
|
-
irregular: options.irregular,
|
|
2470
|
-
koreanPos: koreanPos ?? payload.koreanPos,
|
|
2471
|
-
voice: "active"
|
|
2472
|
-
}
|
|
1649
|
+
sourceCandidate: plan.headTailSourceCandidate
|
|
2473
1650
|
};
|
|
2474
1651
|
}
|
|
2475
|
-
if (
|
|
2476
|
-
const
|
|
2477
|
-
if (
|
|
2478
|
-
|
|
1652
|
+
if (plan.kind === "legacySurfaceComposition") {
|
|
1653
|
+
const suffix = wideScopeNegativeSurfaceSuffix(plan);
|
|
1654
|
+
if (isRenderPlan(suffix)) {
|
|
1655
|
+
const suffixSource = sharedRenderSourceFromPlan(suffix);
|
|
1656
|
+
if (suffixSource.descriptor !== undefined || suffixSource.sourceCandidate !== undefined) {
|
|
1657
|
+
return suffixSource;
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
if (isRenderPlan(plan.prefix)) {
|
|
1661
|
+
return sharedRenderSourceFromPlan(plan.prefix);
|
|
2479
1662
|
}
|
|
2480
|
-
const rewrittenPrefix = replaceLemmaRenderPlan(prefix, options);
|
|
2481
|
-
return rewrittenPrefix === undefined ? undefined : withWakeWrapperPrefix(plan, rewrittenPrefix);
|
|
2482
|
-
}
|
|
2483
|
-
if (plan.kind === "headTailChain" && plan.realization.kind === "predicate") {
|
|
2484
|
-
const root = replaceTailRootStemLemma(plan.realization.root, options);
|
|
2485
|
-
return root === undefined
|
|
2486
|
-
? undefined
|
|
2487
|
-
: { ...plan, realization: { ...plan.realization, root } };
|
|
2488
|
-
}
|
|
2489
|
-
return undefined;
|
|
2490
|
-
}
|
|
2491
|
-
export function renderPlanIsAttributiveModifier(plan) {
|
|
2492
|
-
if (plan === undefined || plan === null || typeof plan === "string") {
|
|
2493
|
-
return false;
|
|
2494
|
-
}
|
|
2495
|
-
if (plan.kind === "attributive") {
|
|
2496
|
-
return true;
|
|
2497
1663
|
}
|
|
2498
|
-
return
|
|
1664
|
+
return { descriptor: undefined, sourceCandidate: undefined };
|
|
2499
1665
|
}
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
1666
|
+
function sharedRenderFallbackHeadKind(plan) {
|
|
1667
|
+
switch (plan.kind) {
|
|
1668
|
+
case "headTailChain":
|
|
1669
|
+
if (plan.realization.kind === "nominal") {
|
|
1670
|
+
return plan.realization.root.kind === "predicateNominalHost" ? "predicate_nominalized" : "nominal";
|
|
1671
|
+
}
|
|
1672
|
+
return "predicate";
|
|
1673
|
+
case "lemma":
|
|
1674
|
+
case "predicateScope":
|
|
1675
|
+
case "predicateNominalScope":
|
|
1676
|
+
return "predicate";
|
|
1677
|
+
default:
|
|
1678
|
+
return "unknown";
|
|
2507
1679
|
}
|
|
2508
|
-
return false;
|
|
2509
1680
|
}
|
|
2510
|
-
|
|
2511
|
-
if (plan === undefined || plan ===
|
|
2512
|
-
return
|
|
1681
|
+
function realizeConjugatedLemma(plan, lookups) {
|
|
1682
|
+
if (plan.adverbial !== undefined && (plan.auxTokens === undefined || plan.auxTokens.length === 0) && plan.voice !== "potential" && plan.voice !== "passive") {
|
|
1683
|
+
return `${plan.prefix ?? ""}${plan.adverbial}${plan.particle === undefined ? "" : selectParticle(plan.adverbial, plan.particle)}${plan.suffix ?? ""}`;
|
|
2513
1684
|
}
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
1685
|
+
let base;
|
|
1686
|
+
if (plan.auxTokens !== undefined && plan.auxTokens.length > 0) {
|
|
1687
|
+
base = plan.voice === "potential"
|
|
1688
|
+
? resolvePotentialChainConnective(plan.koreanLemma, asIrregular(plan.irregular), koreanPredicateAuxChain(plan.auxTokens), plan.ending, {}, lookups)
|
|
1689
|
+
: renderKoreanPredicateConnective(plan.koreanLemma, asIrregular(plan.irregular), plan.koreanPos, koreanPredicateAuxChain(plan.auxTokens), plan.ending, {
|
|
1690
|
+
lookups,
|
|
1691
|
+
...(plan.jpDictForm === undefined || plan.jpDictForm === null ? {} : { jpDictForm: plan.jpDictForm }),
|
|
1692
|
+
...(plan.verbConjType === undefined || plan.verbConjType === null ? {} : { verbConjType: plan.verbConjType }),
|
|
1693
|
+
forcePassive: plan.voice === "passive"
|
|
1694
|
+
});
|
|
2521
1695
|
}
|
|
2522
|
-
if (
|
|
2523
|
-
|
|
1696
|
+
else if (plan.voice === "potential") {
|
|
1697
|
+
base = resolvePotentialChainConnective(plan.koreanLemma, asIrregular(plan.irregular), koreanPredicateAuxChain([]), plan.ending, {}, lookups);
|
|
2524
1698
|
}
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
return null;
|
|
1699
|
+
else {
|
|
1700
|
+
base = conjugate(plan.koreanLemma, asIrregular(plan.irregular), plan.ending);
|
|
2528
1701
|
}
|
|
2529
|
-
|
|
2530
|
-
return {
|
|
2531
|
-
headDictionaryForm: payload?.kind === "attributiveBoundary" ? payload.head.dictionaryForm : null,
|
|
2532
|
-
sourcePast: layerFinalScopeCarriesSourcePast(layer),
|
|
2533
|
-
carriesNonTenseOperator: auxOpsInTailNode(plan.realization.root.tail).some((op) => op.kind !== "tense")
|
|
2534
|
-
};
|
|
1702
|
+
return `${plan.prefix ?? ""}${base}${plan.particle === undefined ? "" : selectParticle(base, plan.particle)}${plan.suffix ?? ""}`;
|
|
2535
1703
|
}
|
|
2536
1704
|
export function renderPlanIsPredicateQuoteCarrierAttributive(plan) {
|
|
2537
1705
|
if (!isPredicateHeadTailChainRenderPlan(plan))
|
|
@@ -2591,13 +1759,6 @@ function mapAuxCognitiveComplementTopic(layer) {
|
|
|
2591
1759
|
export function withCognitiveComplementTopicOp(op) {
|
|
2592
1760
|
return { ...op, cognitiveComplementParticle: "topic" };
|
|
2593
1761
|
}
|
|
2594
|
-
export function buildPredicateGerundProjectionConnective() {
|
|
2595
|
-
return createConnectiveOp({
|
|
2596
|
-
connective: "predicate_projection_tame_gerund",
|
|
2597
|
-
surface: "",
|
|
2598
|
-
source: { tokens: [], tokenIndices: [] }
|
|
2599
|
-
});
|
|
2600
|
-
}
|
|
2601
1762
|
function tailRootHasPredicateQuoteAttributive(root) {
|
|
2602
1763
|
return tailNodeHasPredicateQuoteAttributive(root.tail);
|
|
2603
1764
|
}
|
|
@@ -2609,323 +1770,6 @@ function tailNodeHasPredicateQuoteAttributive(node) {
|
|
|
2609
1770
|
tailNodeHasPredicateQuoteAttributive(node.inner) ||
|
|
2610
1771
|
tailNodeHasPredicateQuoteAttributive(node.outer);
|
|
2611
1772
|
}
|
|
2612
|
-
export function renderPlanHasKoreanLemma(plan, koreanLemma) {
|
|
2613
|
-
if (plan === null || plan === undefined) {
|
|
2614
|
-
return false;
|
|
2615
|
-
}
|
|
2616
|
-
switch (plan.kind) {
|
|
2617
|
-
case "lemma":
|
|
2618
|
-
case "attributive":
|
|
2619
|
-
case "particleizedLemma":
|
|
2620
|
-
case "conjugatedLemma":
|
|
2621
|
-
return "koreanLemma" in plan && plan.koreanLemma === koreanLemma;
|
|
2622
|
-
case "giveRequest":
|
|
2623
|
-
return plan.koreanLemma === koreanLemma || renderPlanHasKoreanLemma(plan.base, koreanLemma);
|
|
2624
|
-
case "predicateScope":
|
|
2625
|
-
case "predicateNominalScope":
|
|
2626
|
-
return renderPlanHasKoreanLemma(plan.base, koreanLemma);
|
|
2627
|
-
case "noda":
|
|
2628
|
-
return isRenderPlan(plan.content) && renderPlanHasKoreanLemma(plan.content, koreanLemma) ||
|
|
2629
|
-
isRenderPlan(plan.prefix) && renderPlanHasKoreanLemma(plan.prefix, koreanLemma);
|
|
2630
|
-
case "copulaPredicate":
|
|
2631
|
-
return plan.koreanLemma === koreanLemma ||
|
|
2632
|
-
(isRenderPlan(plan.base) && renderPlanHasKoreanLemma(plan.base, koreanLemma));
|
|
2633
|
-
case "quoteHostReportingPassive":
|
|
2634
|
-
return plan.lemma === koreanLemma;
|
|
2635
|
-
case "quoteCognitionHost":
|
|
2636
|
-
return koreanLemma === "알 수 있다";
|
|
2637
|
-
case "legacySurfaceComposition":
|
|
2638
|
-
return (isRenderPlan(plan.prefix) && renderPlanHasKoreanLemma(plan.prefix, koreanLemma)) ||
|
|
2639
|
-
(isRenderPlan(plan.suffix) && renderPlanHasKoreanLemma(plan.suffix, koreanLemma));
|
|
2640
|
-
case "semanticCarrierPredicate":
|
|
2641
|
-
return tailRootHasKoreanLemma(plan.root, koreanLemma);
|
|
2642
|
-
case "youdaModality": {
|
|
2643
|
-
const payload = youdaModalityPayload(plan);
|
|
2644
|
-
return payload.koreanLemma === koreanLemma || koreanLemma === "같다" || koreanLemma === "듯하다";
|
|
2645
|
-
}
|
|
2646
|
-
case "reasonBecause": {
|
|
2647
|
-
const payload = reasonBecausePayload(plan);
|
|
2648
|
-
return payload.koreanLemma === koreanLemma;
|
|
2649
|
-
}
|
|
2650
|
-
case "nominalConnectiveScope": {
|
|
2651
|
-
const payload = nominalConnectiveScopePayload(plan);
|
|
2652
|
-
return renderPlanHasKoreanLemma(payload.content, koreanLemma);
|
|
2653
|
-
}
|
|
2654
|
-
case "nominalDemoAru": {
|
|
2655
|
-
const payload = nominalDemoAruPayload(plan);
|
|
2656
|
-
return renderPlanHasKoreanLemma(payload.content, koreanLemma);
|
|
2657
|
-
}
|
|
2658
|
-
case "headTailChain":
|
|
2659
|
-
return plan.realization.kind === "predicate" && tailRootHasKoreanLemma(plan.realization.root, koreanLemma);
|
|
2660
|
-
default:
|
|
2661
|
-
if (isWakeWrapperPlan(plan)) {
|
|
2662
|
-
const prefix = wakeWrapperPrefix(plan);
|
|
2663
|
-
return isRenderPlan(prefix) && renderPlanHasKoreanLemma(prefix, koreanLemma);
|
|
2664
|
-
}
|
|
2665
|
-
return false;
|
|
2666
|
-
}
|
|
2667
|
-
}
|
|
2668
|
-
export function attachTeConnectiveBoundaryChoice(plan, choice) {
|
|
2669
|
-
if (plan === null || plan === undefined) {
|
|
2670
|
-
return undefined;
|
|
2671
|
-
}
|
|
2672
|
-
if (plan.kind === "lemma" || isPredicateHeadTailChainRenderPlan(plan)) {
|
|
2673
|
-
return { ...plan, teConnectiveBoundaryChoice: choice };
|
|
2674
|
-
}
|
|
2675
|
-
if (plan.kind === "legacySurfaceComposition") {
|
|
2676
|
-
if (shouldRewriteSurfaceSuffixOnConnective(plan) && isRenderPlan(plan.suffix)) {
|
|
2677
|
-
const suffix = attachTeConnectiveBoundaryChoice(plan.suffix, choice);
|
|
2678
|
-
if (suffix !== undefined) {
|
|
2679
|
-
return { ...plan, suffix };
|
|
2680
|
-
}
|
|
2681
|
-
}
|
|
2682
|
-
if (shouldRewriteSurfacePrefixOnConnective(plan) && isRenderPlan(plan.prefix)) {
|
|
2683
|
-
const prefix = attachTeConnectiveBoundaryChoice(plan.prefix, choice);
|
|
2684
|
-
if (prefix !== undefined) {
|
|
2685
|
-
return { ...plan, prefix };
|
|
2686
|
-
}
|
|
2687
|
-
}
|
|
2688
|
-
return undefined;
|
|
2689
|
-
}
|
|
2690
|
-
return undefined;
|
|
2691
|
-
}
|
|
2692
|
-
export function extractTeConnectiveBoundaryChoice(plan) {
|
|
2693
|
-
if (plan === null || plan === undefined) {
|
|
2694
|
-
return null;
|
|
2695
|
-
}
|
|
2696
|
-
if (plan.kind === "lemma" || isPredicateHeadTailChainRenderPlan(plan)) {
|
|
2697
|
-
return plan.teConnectiveBoundaryChoice ?? null;
|
|
2698
|
-
}
|
|
2699
|
-
if (plan.kind === "legacySurfaceComposition") {
|
|
2700
|
-
if (shouldRewriteSurfaceSuffixOnConnective(plan) && isRenderPlan(plan.suffix)) {
|
|
2701
|
-
const suffix = extractTeConnectiveBoundaryChoice(plan.suffix);
|
|
2702
|
-
if (suffix !== null) {
|
|
2703
|
-
return suffix;
|
|
2704
|
-
}
|
|
2705
|
-
}
|
|
2706
|
-
if (shouldRewriteSurfacePrefixOnConnective(plan) && isRenderPlan(plan.prefix)) {
|
|
2707
|
-
return extractTeConnectiveBoundaryChoice(plan.prefix);
|
|
2708
|
-
}
|
|
2709
|
-
return null;
|
|
2710
|
-
}
|
|
2711
|
-
return null;
|
|
2712
|
-
}
|
|
2713
|
-
export function replaceConnectiveRenderPlan(plan, options) {
|
|
2714
|
-
if (plan === null || plan === undefined) {
|
|
2715
|
-
return undefined;
|
|
2716
|
-
}
|
|
2717
|
-
if (plan.kind === "lemma") {
|
|
2718
|
-
return { ...plan, connective: options.connective };
|
|
2719
|
-
}
|
|
2720
|
-
if (plan.kind === "attributive") {
|
|
2721
|
-
const auxTokens = plan.auxTokens.filter((token) => (token.pos & POS4) !== 助動詞_タ);
|
|
2722
|
-
return {
|
|
2723
|
-
kind: "conjugatedLemma",
|
|
2724
|
-
koreanLemma: plan.koreanLemma,
|
|
2725
|
-
irregular: plan.irregular,
|
|
2726
|
-
koreanPos: plan.koreanPos,
|
|
2727
|
-
auxTokens,
|
|
2728
|
-
ending: options.connective,
|
|
2729
|
-
voice: plan.voice ?? "active"
|
|
2730
|
-
};
|
|
2731
|
-
}
|
|
2732
|
-
if (plan.kind === "conjugatedLemma" && "koreanLemma" in plan && "koreanPos" in plan && "ending" in plan) {
|
|
2733
|
-
return { ...plan, ending: options.connective };
|
|
2734
|
-
}
|
|
2735
|
-
if (isPredicateHeadTailChainRenderPlan(plan)) {
|
|
2736
|
-
return replaceTailChainConnective(plan, options.connective, options.teFormRole);
|
|
2737
|
-
}
|
|
2738
|
-
if (plan.kind === "legacySurfaceComposition") {
|
|
2739
|
-
const rewriteSuffix = shouldRewriteSurfaceSuffixOnConnective(plan);
|
|
2740
|
-
if (rewriteSuffix && isRenderPlan(plan.suffix)) {
|
|
2741
|
-
const suffix = replaceConnectiveRenderPlan(plan.suffix, options);
|
|
2742
|
-
if (suffix !== undefined) {
|
|
2743
|
-
return { ...plan, suffix };
|
|
2744
|
-
}
|
|
2745
|
-
}
|
|
2746
|
-
const rewritePrefix = shouldRewriteSurfacePrefixOnConnective(plan);
|
|
2747
|
-
if (rewritePrefix && isRenderPlan(plan.prefix)) {
|
|
2748
|
-
const prefix = replaceConnectiveRenderPlan(plan.prefix, options);
|
|
2749
|
-
if (prefix !== undefined) {
|
|
2750
|
-
return { ...plan, prefix };
|
|
2751
|
-
}
|
|
2752
|
-
}
|
|
2753
|
-
return undefined;
|
|
2754
|
-
}
|
|
2755
|
-
if (plan.kind === "giveRequest") {
|
|
2756
|
-
const base = replaceConnectiveRenderPlan(plan.base, options);
|
|
2757
|
-
return base === undefined ? undefined : { ...plan, base };
|
|
2758
|
-
}
|
|
2759
|
-
if (plan.kind === "predicateScope") {
|
|
2760
|
-
const base = replaceConnectiveRenderPlan(plan.base, options);
|
|
2761
|
-
return base === undefined ? undefined : { ...plan, base };
|
|
2762
|
-
}
|
|
2763
|
-
if (isWakeWrapperPlan(plan)) {
|
|
2764
|
-
const prefix = wrapperPrefix(plan);
|
|
2765
|
-
if (!isRenderPlan(prefix)) {
|
|
2766
|
-
return undefined;
|
|
2767
|
-
}
|
|
2768
|
-
const rewrittenPrefix = replaceConnectiveRenderPlan(prefix, options);
|
|
2769
|
-
if (rewrittenPrefix === undefined) {
|
|
2770
|
-
return undefined;
|
|
2771
|
-
}
|
|
2772
|
-
if ("prefix" in plan) {
|
|
2773
|
-
return { ...plan, prefix: rewrittenPrefix };
|
|
2774
|
-
}
|
|
2775
|
-
if (!("payload" in plan)) {
|
|
2776
|
-
return undefined;
|
|
2777
|
-
}
|
|
2778
|
-
const payload = plan.payload;
|
|
2779
|
-
return { ...plan, payload: { ...payload, prefix: rewrittenPrefix } };
|
|
2780
|
-
}
|
|
2781
|
-
return undefined;
|
|
2782
|
-
}
|
|
2783
|
-
export function setForcePassiveRenderPlan(plan, forcePassive) {
|
|
2784
|
-
const voice = forcePassive ? "passive" : "active";
|
|
2785
|
-
if (plan.kind === "lemma") {
|
|
2786
|
-
return { ...plan, voice, forcePassive };
|
|
2787
|
-
}
|
|
2788
|
-
if (plan.kind === "attributive" || plan.kind === "conjugatedLemma") {
|
|
2789
|
-
return { ...plan, voice };
|
|
2790
|
-
}
|
|
2791
|
-
if (plan.kind === "particleizedLemma") {
|
|
2792
|
-
return plan;
|
|
2793
|
-
}
|
|
2794
|
-
if (plan.kind === "legacySurfaceComposition") {
|
|
2795
|
-
const rewritePrefix = shouldRewriteSurfacePrefixOnLemma(plan);
|
|
2796
|
-
const rewriteSuffix = shouldRewriteSurfaceSuffixOnLemma(plan);
|
|
2797
|
-
const prefix = rewritePrefix && isRenderPlan(plan.prefix)
|
|
2798
|
-
? setForcePassiveRenderPlan(plan.prefix, forcePassive)
|
|
2799
|
-
: plan.prefix;
|
|
2800
|
-
if (prefix === undefined && rewritePrefix && isRenderPlan(plan.prefix)) {
|
|
2801
|
-
return undefined;
|
|
2802
|
-
}
|
|
2803
|
-
const suffix = rewriteSuffix && isRenderPlan(plan.suffix)
|
|
2804
|
-
? setForcePassiveRenderPlan(plan.suffix, forcePassive)
|
|
2805
|
-
: plan.suffix;
|
|
2806
|
-
if (suffix === undefined && rewriteSuffix && isRenderPlan(plan.suffix)) {
|
|
2807
|
-
return undefined;
|
|
2808
|
-
}
|
|
2809
|
-
return {
|
|
2810
|
-
...plan,
|
|
2811
|
-
...(prefix === undefined ? {} : { prefix }),
|
|
2812
|
-
...(suffix === undefined ? {} : { suffix })
|
|
2813
|
-
};
|
|
2814
|
-
}
|
|
2815
|
-
if (plan.kind === "giveRequest") {
|
|
2816
|
-
const base = setForcePassiveRenderPlan(plan.base, forcePassive);
|
|
2817
|
-
return base === undefined ? undefined : { ...plan, base };
|
|
2818
|
-
}
|
|
2819
|
-
if (plan.kind === "noda") {
|
|
2820
|
-
if (!isRenderPlan(plan.prefix)) {
|
|
2821
|
-
return undefined;
|
|
2822
|
-
}
|
|
2823
|
-
const prefix = setForcePassiveRenderPlan(plan.prefix, forcePassive);
|
|
2824
|
-
return prefix === undefined ? undefined : { ...plan, prefix };
|
|
2825
|
-
}
|
|
2826
|
-
if (plan.kind === "youdaModality") {
|
|
2827
|
-
const payload = youdaModalityPayload(plan);
|
|
2828
|
-
return { kind: "youdaModality", payload: { ...payload, voice } };
|
|
2829
|
-
}
|
|
2830
|
-
if (isWakeWrapperPlan(plan)) {
|
|
2831
|
-
const prefix = wakeWrapperPrefix(plan);
|
|
2832
|
-
if (!isRenderPlan(prefix)) {
|
|
2833
|
-
return undefined;
|
|
2834
|
-
}
|
|
2835
|
-
const rewrittenPrefix = setForcePassiveRenderPlan(prefix, forcePassive);
|
|
2836
|
-
return rewrittenPrefix === undefined ? undefined : withWakeWrapperPrefix(plan, rewrittenPrefix);
|
|
2837
|
-
}
|
|
2838
|
-
return undefined;
|
|
2839
|
-
}
|
|
2840
|
-
export function setAdversativePassiveRenderPlan(plan, options = {}) {
|
|
2841
|
-
if (plan === null || plan === undefined) {
|
|
2842
|
-
return undefined;
|
|
2843
|
-
}
|
|
2844
|
-
if (plan.kind === "lemma") {
|
|
2845
|
-
return {
|
|
2846
|
-
...plan,
|
|
2847
|
-
adversativePassive: true,
|
|
2848
|
-
adversativePassiveAgentPromoted: options.agentPromoted === true,
|
|
2849
|
-
...(options.baseLemma === undefined
|
|
2850
|
-
? {}
|
|
2851
|
-
: {
|
|
2852
|
-
adversativePassiveBaseLemma: options.baseLemma,
|
|
2853
|
-
adversativePassiveBaseIrregular: options.baseIrregular ?? null
|
|
2854
|
-
})
|
|
2855
|
-
};
|
|
2856
|
-
}
|
|
2857
|
-
if (plan.kind === "legacySurfaceComposition") {
|
|
2858
|
-
const rewritePrefix = shouldRewriteSurfacePrefixOnLemma(plan);
|
|
2859
|
-
const rewriteSuffix = shouldRewriteSurfaceSuffixOnLemma(plan);
|
|
2860
|
-
const prefix = rewritePrefix && isRenderPlan(plan.prefix)
|
|
2861
|
-
? setAdversativePassiveRenderPlan(plan.prefix, options)
|
|
2862
|
-
: plan.prefix;
|
|
2863
|
-
if (prefix === undefined && rewritePrefix && isRenderPlan(plan.prefix)) {
|
|
2864
|
-
return undefined;
|
|
2865
|
-
}
|
|
2866
|
-
const suffix = rewriteSuffix && isRenderPlan(plan.suffix)
|
|
2867
|
-
? setAdversativePassiveRenderPlan(plan.suffix, options)
|
|
2868
|
-
: plan.suffix;
|
|
2869
|
-
if (suffix === undefined && rewriteSuffix && isRenderPlan(plan.suffix)) {
|
|
2870
|
-
return undefined;
|
|
2871
|
-
}
|
|
2872
|
-
return {
|
|
2873
|
-
...plan,
|
|
2874
|
-
...(prefix === undefined ? {} : { prefix }),
|
|
2875
|
-
...(suffix === undefined ? {} : { suffix })
|
|
2876
|
-
};
|
|
2877
|
-
}
|
|
2878
|
-
return undefined;
|
|
2879
|
-
}
|
|
2880
|
-
export function setPassiveClassRenderPlan(plan, passiveClass) {
|
|
2881
|
-
if (plan === null || plan === undefined) {
|
|
2882
|
-
return undefined;
|
|
2883
|
-
}
|
|
2884
|
-
if (plan.kind === "lemma" || plan.kind === "attributive") {
|
|
2885
|
-
return {
|
|
2886
|
-
...plan,
|
|
2887
|
-
passiveClass
|
|
2888
|
-
};
|
|
2889
|
-
}
|
|
2890
|
-
if (plan.kind === "legacySurfaceComposition") {
|
|
2891
|
-
const rewritePrefix = shouldRewriteSurfacePrefixOnLemma(plan);
|
|
2892
|
-
const rewriteSuffix = shouldRewriteSurfaceSuffixOnLemma(plan);
|
|
2893
|
-
const prefix = rewritePrefix && isRenderPlan(plan.prefix)
|
|
2894
|
-
? setPassiveClassRenderPlan(plan.prefix, passiveClass)
|
|
2895
|
-
: plan.prefix;
|
|
2896
|
-
if (prefix === undefined && rewritePrefix && isRenderPlan(plan.prefix)) {
|
|
2897
|
-
return undefined;
|
|
2898
|
-
}
|
|
2899
|
-
const suffix = rewriteSuffix && isRenderPlan(plan.suffix)
|
|
2900
|
-
? setPassiveClassRenderPlan(plan.suffix, passiveClass)
|
|
2901
|
-
: plan.suffix;
|
|
2902
|
-
if (suffix === undefined && rewriteSuffix && isRenderPlan(plan.suffix)) {
|
|
2903
|
-
return undefined;
|
|
2904
|
-
}
|
|
2905
|
-
return {
|
|
2906
|
-
...plan,
|
|
2907
|
-
...(prefix === undefined ? {} : { prefix }),
|
|
2908
|
-
...(suffix === undefined ? {} : { suffix })
|
|
2909
|
-
};
|
|
2910
|
-
}
|
|
2911
|
-
if (plan.kind === "predicateScope") {
|
|
2912
|
-
const base = setPassiveClassRenderPlan(plan.base, passiveClass);
|
|
2913
|
-
return base === undefined ? undefined : { ...plan, base };
|
|
2914
|
-
}
|
|
2915
|
-
if (plan.kind === "predicateNominalScope") {
|
|
2916
|
-
const base = setPassiveClassRenderPlan(plan.base, passiveClass);
|
|
2917
|
-
return base === undefined ? undefined : { ...plan, base };
|
|
2918
|
-
}
|
|
2919
|
-
if (plan.kind === "noda" && isRenderPlan(plan.prefix)) {
|
|
2920
|
-
const prefix = setPassiveClassRenderPlan(plan.prefix, passiveClass);
|
|
2921
|
-
return prefix === undefined ? undefined : { ...plan, prefix };
|
|
2922
|
-
}
|
|
2923
|
-
if (plan.kind === "youdaModality") {
|
|
2924
|
-
const payload = youdaModalityPayload(plan);
|
|
2925
|
-
return { kind: "youdaModality", payload: { ...payload, passiveClass } };
|
|
2926
|
-
}
|
|
2927
|
-
return undefined;
|
|
2928
|
-
}
|
|
2929
1773
|
function realizeLemma(plan, formal, lookups, hostOptions) {
|
|
2930
1774
|
const koreanLemma = plan.koreanLemma;
|
|
2931
1775
|
const koreanPos = plan.koreanPos;
|
|
@@ -3808,96 +2652,6 @@ function requireRenderPlan(value, kind) {
|
|
|
3808
2652
|
}
|
|
3809
2653
|
return value;
|
|
3810
2654
|
}
|
|
3811
|
-
function tailRootHasKoreanLemma(root, koreanLemma) {
|
|
3812
|
-
return tailNodeHasKoreanLemma(root.tail, koreanLemma);
|
|
3813
|
-
}
|
|
3814
|
-
function tailNodeHasKoreanLemma(node, koreanLemma) {
|
|
3815
|
-
if (node.kind === "auxLayer") {
|
|
3816
|
-
return auxLayerHasKoreanLemma(node, koreanLemma);
|
|
3817
|
-
}
|
|
3818
|
-
return auxLayerHasKoreanLemma(node.inner, koreanLemma) || tailNodeHasKoreanLemma(node.outer, koreanLemma);
|
|
3819
|
-
}
|
|
3820
|
-
function auxLayerHasKoreanLemma(node, koreanLemma) {
|
|
3821
|
-
const stem = node.stem;
|
|
3822
|
-
if (stem.kind === "candidateSet") {
|
|
3823
|
-
return stem.candidates.some((candidate) => candidate.lemma === koreanLemma);
|
|
3824
|
-
}
|
|
3825
|
-
return stem.lemma === koreanLemma;
|
|
3826
|
-
}
|
|
3827
|
-
function predicatePayloadBase(plan) {
|
|
3828
|
-
return {
|
|
3829
|
-
entry: plan.entry ?? null,
|
|
3830
|
-
koreanLemma: plan.koreanLemma,
|
|
3831
|
-
irregular: plan.irregular,
|
|
3832
|
-
koreanPos: plan.koreanPos,
|
|
3833
|
-
auxTokens: plan.auxTokens,
|
|
3834
|
-
contentToken: plan.contentToken,
|
|
3835
|
-
voice: plan.voice ?? "active",
|
|
3836
|
-
verbConjType: plan.verbConjType ?? null,
|
|
3837
|
-
jpDictForm: plan.jpDictForm ?? null,
|
|
3838
|
-
...(plan.passiveClass === undefined ? {} : { passiveClass: plan.passiveClass }),
|
|
3839
|
-
sahenCompound: plan.sahenCompound ?? false,
|
|
3840
|
-
sahenNoun: plan.sahenNoun ?? null,
|
|
3841
|
-
};
|
|
3842
|
-
}
|
|
3843
|
-
function youdaModalityPayload(plan) {
|
|
3844
|
-
if ("payload" in plan) {
|
|
3845
|
-
return plan.payload;
|
|
3846
|
-
}
|
|
3847
|
-
return {
|
|
3848
|
-
...predicatePayloadBase(plan),
|
|
3849
|
-
mode: plan.mode,
|
|
3850
|
-
modalAux: plan.modalAux,
|
|
3851
|
-
connective: plan.connective ?? null,
|
|
3852
|
-
sfp: plan.sfp ?? null
|
|
3853
|
-
};
|
|
3854
|
-
}
|
|
3855
|
-
function reasonBecausePayload(plan) {
|
|
3856
|
-
if ("payload" in plan) {
|
|
3857
|
-
return plan.payload;
|
|
3858
|
-
}
|
|
3859
|
-
return {
|
|
3860
|
-
entry: plan.entry ?? null,
|
|
3861
|
-
koreanLemma: plan.koreanLemma,
|
|
3862
|
-
irregular: plan.irregular,
|
|
3863
|
-
auxTokens: plan.auxTokens,
|
|
3864
|
-
koreanPos: plan.koreanPos,
|
|
3865
|
-
projection: plan.projection ?? "adverbial",
|
|
3866
|
-
voice: plan.voice ?? "active",
|
|
3867
|
-
verbConjType: plan.verbConjType ?? null,
|
|
3868
|
-
jpDictForm: plan.jpDictForm ?? null,
|
|
3869
|
-
sahenCompound: plan.sahenCompound ?? false,
|
|
3870
|
-
sahenNoun: plan.sahenNoun ?? null,
|
|
3871
|
-
...(plan.negative === undefined ? {} : { negative: plan.negative }),
|
|
3872
|
-
...(plan.past === undefined ? {} : { past: plan.past }),
|
|
3873
|
-
...(plan.polarityTransition === undefined ? {} : { polarityTransition: plan.polarityTransition }),
|
|
3874
|
-
...(plan.predicateRoot === undefined ? {} : { predicateRoot: plan.predicateRoot }),
|
|
3875
|
-
...(plan.predicateHostProjection === undefined ? {} : { predicateHostProjection: plan.predicateHostProjection }),
|
|
3876
|
-
...(plan.passiveClass === undefined ? {} : { passiveClass: plan.passiveClass })
|
|
3877
|
-
};
|
|
3878
|
-
}
|
|
3879
|
-
function nominalConnectiveScopePayload(plan) {
|
|
3880
|
-
if ("payload" in plan) {
|
|
3881
|
-
return plan.payload;
|
|
3882
|
-
}
|
|
3883
|
-
return {
|
|
3884
|
-
content: plan.content,
|
|
3885
|
-
connectiveKind: plan.connectiveKind,
|
|
3886
|
-
koreanPos: plan.koreanPos ?? null
|
|
3887
|
-
};
|
|
3888
|
-
}
|
|
3889
|
-
function nominalDemoAruPayload(plan) {
|
|
3890
|
-
if ("payload" in plan) {
|
|
3891
|
-
return plan.payload;
|
|
3892
|
-
}
|
|
3893
|
-
return {
|
|
3894
|
-
content: plan.content,
|
|
3895
|
-
auxTokens: plan.auxTokens,
|
|
3896
|
-
mode: plan.mode,
|
|
3897
|
-
connective: plan.connective ?? null,
|
|
3898
|
-
koreanPos: plan.koreanPos ?? null
|
|
3899
|
-
};
|
|
3900
|
-
}
|
|
3901
2655
|
function compoundNominalSuffixPayload(plan) {
|
|
3902
2656
|
return plan.payload;
|
|
3903
2657
|
}
|
|
@@ -3913,20 +2667,6 @@ function wakeExplanationPayload(plan) {
|
|
|
3913
2667
|
connectiveEnding: plan.connectiveEnding ?? null
|
|
3914
2668
|
};
|
|
3915
2669
|
}
|
|
3916
|
-
function rewriteSimilePredicatePayloadLemma(plan, options, stripOptions) {
|
|
3917
|
-
const payload = youdaModalityPayload(plan);
|
|
3918
|
-
const [auxTokens, replacementToken] = rewriteAuxTokensWithReplacement(payload.auxTokens, stripOptions);
|
|
3919
|
-
const rewrittenPayload = {
|
|
3920
|
-
...payload,
|
|
3921
|
-
koreanLemma: options.koreanLemma,
|
|
3922
|
-
irregular: options.irregular,
|
|
3923
|
-
koreanPos: options.koreanPos || payload.koreanPos,
|
|
3924
|
-
auxTokens,
|
|
3925
|
-
contentToken: replacementToken ?? payload.contentToken,
|
|
3926
|
-
voice: "active"
|
|
3927
|
-
};
|
|
3928
|
-
return { kind: plan.kind, payload: rewrittenPayload };
|
|
3929
|
-
}
|
|
3930
2670
|
function realizeNamedRenderPlan(plan, formal, lookups, numeric) {
|
|
3931
2671
|
if (plan.kind === "legacySurfaceComposition") {
|
|
3932
2672
|
return `${renderPlanText(plan.prefix, formal, lookups, numeric)}${plan.text ?? plan.korean ?? ""}${renderPlanText(wideScopeNegativeSurfaceSuffix(plan), formal, lookups, numeric)}`;
|
|
@@ -4636,127 +3376,6 @@ function requireNumericTables(numeric, context) {
|
|
|
4636
3376
|
}
|
|
4637
3377
|
return numeric;
|
|
4638
3378
|
}
|
|
4639
|
-
function auxTokensOf(plan) {
|
|
4640
|
-
return plan.auxTokens;
|
|
4641
|
-
}
|
|
4642
|
-
function rewriteAuxTokens(auxTokens, options) {
|
|
4643
|
-
return rewriteAuxTokensWithReplacement(auxTokens, options)[0];
|
|
4644
|
-
}
|
|
4645
|
-
function rewriteAuxTokensWithReplacement(auxTokens, options) {
|
|
4646
|
-
let updated = [...auxTokens];
|
|
4647
|
-
let replacementToken = null;
|
|
4648
|
-
if (options.dropFirstPassiveAux) {
|
|
4649
|
-
let removedAux = null;
|
|
4650
|
-
const filtered = [];
|
|
4651
|
-
let removed = false;
|
|
4652
|
-
for (const aux of updated) {
|
|
4653
|
-
const pos4 = aux.pos & POS4;
|
|
4654
|
-
const pos5 = aux.pos & POS5;
|
|
4655
|
-
if (!removed && (pos4 === 助動詞_レル)) {
|
|
4656
|
-
removed = true;
|
|
4657
|
-
removedAux = aux;
|
|
4658
|
-
if ((pos5 & _撥音便) === _撥音便) {
|
|
4659
|
-
filtered.push(syntheticNuAuxToken());
|
|
4660
|
-
}
|
|
4661
|
-
continue;
|
|
4662
|
-
}
|
|
4663
|
-
filtered.push(aux);
|
|
4664
|
-
}
|
|
4665
|
-
updated = filtered;
|
|
4666
|
-
replacementToken = removedAux !== null && updated.length === 0 ? removedAux : null;
|
|
4667
|
-
}
|
|
4668
|
-
if (options.dropFirstCausativeAux) {
|
|
4669
|
-
let removedAux = null;
|
|
4670
|
-
const filtered = [];
|
|
4671
|
-
let removed = false;
|
|
4672
|
-
for (const aux of updated) {
|
|
4673
|
-
const dictionaryForm = aux.dictionaryForm;
|
|
4674
|
-
if (!removed && (dictionaryForm === "せる" || dictionaryForm === "させる")) {
|
|
4675
|
-
removed = true;
|
|
4676
|
-
removedAux = aux;
|
|
4677
|
-
continue;
|
|
4678
|
-
}
|
|
4679
|
-
filtered.push(aux);
|
|
4680
|
-
}
|
|
4681
|
-
updated = filtered;
|
|
4682
|
-
replacementToken = removedAux !== null && updated.length === 0 ? removedAux : replacementToken;
|
|
4683
|
-
}
|
|
4684
|
-
if (options.dropFirstNegativeAux) {
|
|
4685
|
-
let removedAux = null;
|
|
4686
|
-
const filtered = [];
|
|
4687
|
-
let removed = false;
|
|
4688
|
-
for (const aux of updated) {
|
|
4689
|
-
const pos4 = aux.pos & POS4;
|
|
4690
|
-
if (!removed && ((pos4 === 助動詞_ナイ) || (pos4 === 助動詞_ヌ))) {
|
|
4691
|
-
removed = true;
|
|
4692
|
-
removedAux = aux;
|
|
4693
|
-
continue;
|
|
4694
|
-
}
|
|
4695
|
-
filtered.push(aux);
|
|
4696
|
-
}
|
|
4697
|
-
updated = filtered;
|
|
4698
|
-
replacementToken = removedAux !== null && updated.length === 0 ? removedAux : replacementToken;
|
|
4699
|
-
}
|
|
4700
|
-
return [updated, replacementToken];
|
|
4701
|
-
}
|
|
4702
|
-
function syntheticNuAuxToken() {
|
|
4703
|
-
return {
|
|
4704
|
-
surface: "ん",
|
|
4705
|
-
dictionaryForm: "ぬ",
|
|
4706
|
-
reading: "",
|
|
4707
|
-
dictionaryFormReading: "",
|
|
4708
|
-
pos: 助動詞 | 助動詞_ヌ | 終止形_撥音便,
|
|
4709
|
-
dictionaryId: -1
|
|
4710
|
-
};
|
|
4711
|
-
}
|
|
4712
|
-
export function isWakeWrapperPlan(plan) {
|
|
4713
|
-
return plan.kind === "wakeExplanation";
|
|
4714
|
-
}
|
|
4715
|
-
export function isWakePrefixPlan(plan) {
|
|
4716
|
-
return isWakeWrapperPlan(plan);
|
|
4717
|
-
}
|
|
4718
|
-
function wakeWrapperPrefix(plan) {
|
|
4719
|
-
if ("prefix" in plan && plan.prefix !== undefined) {
|
|
4720
|
-
return plan.prefix ?? undefined;
|
|
4721
|
-
}
|
|
4722
|
-
if ("payload" in plan && "prefix" in plan.payload) {
|
|
4723
|
-
return plan.payload.prefix;
|
|
4724
|
-
}
|
|
4725
|
-
return undefined;
|
|
4726
|
-
}
|
|
4727
|
-
function withWakeWrapperPrefix(plan, prefix) {
|
|
4728
|
-
if ("prefix" in plan) {
|
|
4729
|
-
return { ...plan, prefix };
|
|
4730
|
-
}
|
|
4731
|
-
if ("payload" in plan && "prefix" in plan.payload) {
|
|
4732
|
-
return { ...plan, payload: { ...plan.payload, prefix } };
|
|
4733
|
-
}
|
|
4734
|
-
return plan;
|
|
4735
|
-
}
|
|
4736
|
-
function wrapperPrefix(plan) {
|
|
4737
|
-
if ("prefix" in plan && plan.prefix !== undefined) {
|
|
4738
|
-
return plan.prefix ?? undefined;
|
|
4739
|
-
}
|
|
4740
|
-
if ("payload" in plan && "prefix" in plan.payload) {
|
|
4741
|
-
return plan.payload.prefix;
|
|
4742
|
-
}
|
|
4743
|
-
return undefined;
|
|
4744
|
-
}
|
|
4745
|
-
function shouldRewriteSurfacePrefixOnLemma(plan) {
|
|
4746
|
-
return plan.rewritePrefixOnLemmaReplace === true;
|
|
4747
|
-
}
|
|
4748
|
-
function shouldRewriteSurfaceSuffixOnLemma(plan) {
|
|
4749
|
-
return plan.rewriteSuffixOnLemmaReplace === true;
|
|
4750
|
-
}
|
|
4751
|
-
function shouldRewriteSurfacePrefixOnConnective(plan) {
|
|
4752
|
-
return plan.rewritePrefixOnConnectiveReplace === true;
|
|
4753
|
-
}
|
|
4754
|
-
function shouldRewriteSurfaceSuffixOnConnective(plan) {
|
|
4755
|
-
return plan.rewriteSuffixOnConnectiveReplace === true;
|
|
4756
|
-
}
|
|
4757
|
-
function isRenderPlan(value) {
|
|
4758
|
-
return value !== undefined && value !== null && typeof value !== "string";
|
|
4759
|
-
}
|
|
4760
3379
|
export function generateCopulaNegation(koreanLemma, options = {}) {
|
|
4761
3380
|
const polite = options.polite ?? false;
|
|
4762
3381
|
const formal = options.formal ?? false;
|