harumt 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.en.md +24 -21
- package/README.md +66 -73
- package/data/config/lookup_tables.toml +9 -4
- package/dist/analyzer/config.js +1 -3
- package/dist/analyzer/connect.d.ts +1 -1
- package/dist/analyzer/connect.js +2 -1
- package/dist/analyzer/dictionary-provider.d.ts +2 -0
- package/dist/analyzer/dictionary-provider.js +3 -0
- package/dist/analyzer/haru-dictionary-provider.js +17 -6
- package/dist/analyzer/node-dictionary-provider.d.ts +19 -8
- package/dist/analyzer/node-dictionary-provider.js +109 -48
- package/dist/analyzer/node-helpers.js +12 -18
- package/dist/analyzer/page-cached-source.d.ts +59 -0
- package/dist/analyzer/page-cached-source.js +157 -0
- package/dist/analyzer-lexicon.js +6 -1
- package/dist/default-provider.d.ts +1 -1
- package/dist/default-provider.js +14 -6
- package/dist/dictionary/derivation.d.ts +0 -1
- package/dist/dictionary/morpheme.js +13 -7
- package/dist/dictionary/pattern.js +1 -1
- package/dist/dictionary/sense-normalization.js +3 -3
- package/dist/generator/aux-map.d.ts +1 -0
- package/dist/generator/aux-map.js +1 -1
- package/dist/generator/conjugator.d.ts +0 -1
- package/dist/generator/conjugator.js +0 -3
- package/dist/generator/numerals.d.ts +0 -1
- package/dist/generator/numerals.js +0 -3
- package/dist/pipeline/assembler/affix-helpers.d.ts +14 -0
- package/dist/pipeline/assembler/affix-helpers.js +154 -0
- package/dist/pipeline/assembler/content-override.d.ts +3 -0
- package/dist/pipeline/assembler/content-override.js +79 -0
- package/dist/pipeline/assembler/copula-focus-plan.d.ts +10 -0
- package/dist/pipeline/assembler/copula-focus-plan.js +32 -0
- package/dist/pipeline/assembler/copula-helpers.d.ts +31 -0
- package/dist/pipeline/assembler/copula-helpers.js +192 -0
- package/dist/pipeline/assembler/lexical-layout-hypothesis.d.ts +59 -0
- package/dist/pipeline/assembler/lexical-layout-hypothesis.js +357 -0
- package/dist/pipeline/assembler/light-verb-projection.d.ts +21 -0
- package/dist/pipeline/assembler/light-verb-projection.js +43 -0
- package/dist/pipeline/assembler/nande-reason.d.ts +4 -0
- package/dist/pipeline/assembler/nande-reason.js +162 -0
- package/dist/pipeline/assembler/particle-helpers.d.ts +10 -0
- package/dist/pipeline/assembler/particle-helpers.js +57 -0
- package/dist/pipeline/assembler/quantity-spans.d.ts +24 -0
- package/dist/pipeline/assembler/quantity-spans.js +58 -0
- package/dist/pipeline/assembler/question-plan.d.ts +5 -0
- package/dist/pipeline/assembler/question-plan.js +121 -0
- package/dist/pipeline/assembler/quote-helpers.d.ts +11 -0
- package/dist/pipeline/assembler/quote-helpers.js +67 -0
- package/dist/pipeline/assembler.d.ts +47 -31
- package/dist/pipeline/assembler.js +1219 -3234
- package/dist/pipeline/assembly-content-span.d.ts +59 -0
- package/dist/pipeline/assembly-content-span.js +149 -0
- package/dist/pipeline/attributive.d.ts +2 -2
- package/dist/pipeline/attributive.js +2 -5
- package/dist/pipeline/candidate-runtime.d.ts +2 -30
- package/dist/pipeline/candidate-runtime.js +4 -125
- package/dist/pipeline/clause-layout/adverbial-predicate.d.ts +22 -0
- package/dist/pipeline/clause-layout/adverbial-predicate.js +180 -0
- package/dist/pipeline/clause-layout/attributive-boundaries.d.ts +12 -0
- package/dist/pipeline/clause-layout/attributive-boundaries.js +325 -0
- package/dist/pipeline/clause-layout/boundary-detection.d.ts +100 -0
- package/dist/pipeline/clause-layout/boundary-detection.js +729 -0
- package/dist/pipeline/clause-layout/boundary-event-common.d.ts +8 -0
- package/dist/pipeline/clause-layout/boundary-event-common.js +50 -0
- package/dist/pipeline/clause-layout/boundary-settlement.d.ts +40 -0
- package/dist/pipeline/clause-layout/boundary-settlement.js +534 -0
- package/dist/pipeline/clause-layout/chuushi-closure.js +1 -2
- package/dist/pipeline/clause-layout/connective-boundaries.d.ts +34 -0
- package/dist/pipeline/clause-layout/connective-boundaries.js +1049 -0
- package/dist/pipeline/clause-layout/final-layout.d.ts +155 -0
- package/dist/pipeline/clause-layout/final-layout.js +544 -0
- package/dist/pipeline/clause-layout/index.d.ts +5 -597
- package/dist/pipeline/clause-layout/index.js +69 -6576
- package/dist/pipeline/clause-layout/juncture-verdict.d.ts +1 -3
- package/dist/pipeline/clause-layout/layout-types.d.ts +142 -0
- package/dist/pipeline/clause-layout/layout-types.js +16 -0
- package/dist/pipeline/clause-layout/lexical-adverbial-affiliation.d.ts +1 -1
- package/dist/pipeline/clause-layout/navigation.d.ts +48 -0
- package/dist/pipeline/clause-layout/navigation.js +264 -0
- package/dist/pipeline/clause-layout/nominal-anchor-evidence.d.ts +57 -0
- package/dist/pipeline/clause-layout/nominal-anchor-evidence.js +180 -0
- package/dist/pipeline/clause-layout/nominal-anchors.d.ts +9 -0
- package/dist/pipeline/clause-layout/nominal-anchors.js +318 -0
- package/dist/pipeline/clause-layout/nominal-binding.d.ts +1 -1
- package/dist/pipeline/clause-layout/nominal-binding.js +1 -1
- package/dist/pipeline/clause-layout/nominal-frame-reach.d.ts +7 -0
- package/dist/pipeline/clause-layout/nominal-frame-reach.js +77 -0
- package/dist/pipeline/clause-layout/particle-phrase-copula.d.ts +1 -1
- package/dist/pipeline/clause-layout/phrase-enumeration.d.ts +1 -1
- package/dist/pipeline/clause-layout/phrase-enumeration.js +2 -1
- package/dist/pipeline/clause-layout/predicate-ownership.d.ts +22 -0
- package/dist/pipeline/clause-layout/predicate-ownership.js +323 -0
- package/dist/pipeline/clause-layout/predicate-parallel.d.ts +2 -1
- package/dist/pipeline/clause-layout/predicate-parallel.js +16 -1
- package/dist/pipeline/clause-layout/predicate-shape.d.ts +49 -0
- package/dist/pipeline/clause-layout/predicate-shape.js +369 -0
- package/dist/pipeline/clause-layout/predicate-token-shape.d.ts +15 -0
- package/dist/pipeline/clause-layout/predicate-token-shape.js +142 -0
- package/dist/pipeline/clause-layout/prenominal-head-reach.d.ts +29 -0
- package/dist/pipeline/clause-layout/prenominal-head-reach.js +349 -0
- package/dist/pipeline/clause-layout/proto-layout.d.ts +144 -0
- package/dist/pipeline/clause-layout/proto-layout.js +327 -0
- package/dist/pipeline/clause-layout/proto-state.d.ts +2 -1
- package/dist/pipeline/clause-layout/punctuated-copula.d.ts +1 -1
- package/dist/pipeline/clause-layout/punctuation.d.ts +8 -0
- package/dist/pipeline/clause-layout/punctuation.js +33 -0
- package/dist/pipeline/clause-layout/quote-classification.d.ts +48 -0
- package/dist/pipeline/clause-layout/quote-classification.js +430 -0
- package/dist/pipeline/clause-layout/quote-delimiters.d.ts +2 -0
- package/dist/pipeline/clause-layout/quote-delimiters.js +16 -0
- package/dist/pipeline/clause-layout/renyou-verb-reading.d.ts +1 -1
- package/dist/pipeline/clause-layout/speech-act.js +1 -1
- package/dist/pipeline/clause-layout/token-evidence.d.ts +11 -0
- package/dist/pipeline/clause-layout/token-evidence.js +41 -0
- package/dist/pipeline/clause-layout/trivia.d.ts +5 -0
- package/dist/pipeline/clause-layout/trivia.js +18 -1
- package/dist/pipeline/clause-layout/utterance-boundaries.d.ts +41 -0
- package/dist/pipeline/clause-layout/utterance-boundaries.js +627 -0
- package/dist/pipeline/clause-layout/vocative.d.ts +5 -0
- package/dist/pipeline/clause-layout/vocative.js +91 -0
- package/dist/pipeline/clause-layout/whitespace-attributive-reading.d.ts +1 -1
- package/dist/pipeline/clause-layout/whitespace-attributive-reading.js +4 -1
- package/dist/pipeline/commitment/adverbial-adjunct-routing.d.ts +3 -0
- package/dist/pipeline/commitment/adverbial-adjunct-routing.js +109 -0
- package/dist/pipeline/commitment/benefactive-span-hydration.d.ts +5 -0
- package/dist/pipeline/commitment/benefactive-span-hydration.js +49 -0
- package/dist/pipeline/commitment/candidate-projection.d.ts +29 -0
- package/dist/pipeline/commitment/candidate-projection.js +512 -0
- package/dist/pipeline/commitment/connective-refinement.d.ts +8 -0
- package/dist/pipeline/commitment/connective-refinement.js +152 -0
- package/dist/pipeline/commitment/deferred-reanalysis.d.ts +1 -1
- package/dist/pipeline/commitment/final-sense-sync.d.ts +8 -0
- package/dist/pipeline/commitment/final-sense-sync.js +264 -0
- package/dist/pipeline/commitment/head-owner-candidate-selection.d.ts +15 -0
- package/dist/pipeline/commitment/head-owner-candidate-selection.js +158 -0
- package/dist/pipeline/commitment/particle-roles.d.ts +1 -1
- package/dist/pipeline/commitment/particle-roles.js +546 -398
- package/dist/pipeline/commitment/passive-class.d.ts +1 -1
- package/dist/pipeline/commitment/passive-class.js +2 -3
- package/dist/pipeline/commitment/quantity-span-commitment.d.ts +4 -0
- package/dist/pipeline/commitment/quantity-span-commitment.js +37 -0
- package/dist/pipeline/commitment/quote-refinement.d.ts +6 -0
- package/dist/pipeline/commitment/quote-refinement.js +130 -0
- package/dist/pipeline/commitment/role-case-shadow.d.ts +0 -4
- package/dist/pipeline/commitment/role-case-shadow.js +0 -3
- package/dist/pipeline/commitment/semantic-frame.d.ts +1 -1
- package/dist/pipeline/commitment/semantic-frame.js +2 -3
- package/dist/pipeline/commitment/span-evidence.d.ts +2 -3
- package/dist/pipeline/commitment/span-evidence.js +7 -18
- package/dist/pipeline/commitment/stem-candidate-selection.d.ts +24 -0
- package/dist/pipeline/commitment/stem-candidate-selection.js +663 -0
- package/dist/pipeline/commitment/te-connective-resolution.d.ts +1 -1
- package/dist/pipeline/commitment/te-connective-resolution.js +0 -1
- package/dist/pipeline/commitment/types.d.ts +1 -1
- package/dist/pipeline/commitment/types.js +1 -1
- package/dist/pipeline/commitment/voice-reading-resolution.d.ts +1 -1
- package/dist/pipeline/commitment/voice-reading-resolution.js +117 -34
- package/dist/pipeline/compounds/compound-tail-tokens.d.ts +12 -0
- package/dist/pipeline/compounds/compound-tail-tokens.js +37 -0
- package/dist/pipeline/compounds/compound-translation-candidates.d.ts +49 -0
- package/dist/pipeline/compounds/compound-translation-candidates.js +154 -0
- package/dist/pipeline/compounds/compound-verbs.js +4 -9
- package/dist/pipeline/compounds/index.d.ts +24 -29
- package/dist/pipeline/compounds/index.js +361 -383
- package/dist/pipeline/content-resolver/postaux-pattern-rendering.d.ts +0 -2
- package/dist/pipeline/content-resolver/postaux-pattern-rendering.js +1 -5
- package/dist/pipeline/content-resolver/types.d.ts +0 -4
- package/dist/pipeline/content-resolver.js +641 -492
- package/dist/pipeline/context.d.ts +2 -1
- package/dist/pipeline/context.js +4 -3
- package/dist/pipeline/core.d.ts +8 -95
- package/dist/pipeline/core.js +1339 -7183
- package/dist/pipeline/deferred-commitment.d.ts +2 -17
- package/dist/pipeline/deferred-commitment.js +406 -2353
- package/dist/pipeline/demo-discourse.d.ts +1 -1
- package/dist/pipeline/fallback/index.d.ts +0 -1
- package/dist/pipeline/fallback/index.js +3 -7
- package/dist/pipeline/fallback/orphan-unit-absorption.d.ts +4 -0
- package/dist/pipeline/fallback/orphan-unit-absorption.js +57 -0
- package/dist/pipeline/fallback/unsupported-raw.d.ts +0 -2
- package/dist/pipeline/fallback/unsupported-raw.js +0 -10
- package/dist/pipeline/head-tail/boundary/clause-start.js +1 -10
- package/dist/pipeline/head-tail/boundary/ka-ownership.d.ts +3 -2
- package/dist/pipeline/head-tail/boundary/ka-ownership.js +16 -9
- package/dist/pipeline/head-tail/boundary/marker.js +1 -1
- package/dist/pipeline/head-tail/boundary/punctuation.d.ts +0 -1
- package/dist/pipeline/head-tail/boundary/punctuation.js +1 -6
- package/dist/pipeline/head-tail/boundary/quote-marker.js +1 -1
- package/dist/pipeline/head-tail/candidate/collect.d.ts +3 -3
- package/dist/pipeline/head-tail/candidate/context.d.ts +1 -1
- package/dist/pipeline/head-tail/candidate/context.js +1 -1
- package/dist/pipeline/head-tail/candidate/evidence.d.ts +0 -2
- package/dist/pipeline/head-tail/candidate/evidence.js +0 -22
- package/dist/pipeline/head-tail/candidate/owner-payload.d.ts +1 -1
- package/dist/pipeline/head-tail/candidate/semantic-classifiers.d.ts +2 -1
- package/dist/pipeline/head-tail/data/honorific-formulaic-arm-table.d.ts +0 -1
- package/dist/pipeline/head-tail/data/honorific-formulaic-arm-table.js +0 -3
- package/dist/pipeline/head-tail/data/quoted-reporting-sets.d.ts +2 -0
- package/dist/pipeline/head-tail/data/quoted-reporting-sets.js +4 -0
- package/dist/pipeline/head-tail/grammar.d.ts +0 -1
- package/dist/pipeline/head-tail/head/adapters/nominal/commit.js +3 -2
- package/dist/pipeline/head-tail/head/adapters/nominal/grammar.d.ts +2 -1
- package/dist/pipeline/head-tail/head/adapters/nominal/integration.d.ts +2 -2
- package/dist/pipeline/head-tail/head/adapters/nominal/integration.js +6 -6
- package/dist/pipeline/head-tail/head/adapters/nominal/owner-arbitration.d.ts +1 -1
- package/dist/pipeline/head-tail/head/adapters/nominal/parser.d.ts +1 -2
- package/dist/pipeline/head-tail/head/adapters/nominal/parser.js +20 -24
- package/dist/pipeline/head-tail/head/adapters/nominal/plan-lifecycle.d.ts +1 -1
- package/dist/pipeline/head-tail/head/adapters/nominal/renyou-nominal-head.js +2 -2
- package/dist/pipeline/head-tail/integration/content-head-dispatch.d.ts +5 -6
- package/dist/pipeline/head-tail/integration/content-head-dispatch.js +2 -5
- package/dist/pipeline/head-tail/integration/copula-focus-adjunct.js +1 -1
- package/dist/pipeline/head-tail/integration/copula-host-chain.js +1 -1
- package/dist/pipeline/head-tail/integration/honorific-formulaic-host.d.ts +25 -0
- package/dist/pipeline/head-tail/integration/honorific-formulaic-host.js +142 -0
- package/dist/pipeline/head-tail/integration/nominal-assembly.d.ts +2 -2
- package/dist/pipeline/head-tail/integration/nominal-assembly.js +1 -1
- package/dist/pipeline/head-tail/integration/particle-phrase-copula.d.ts +1 -1
- package/dist/pipeline/head-tail/integration/semantic-carrier-predicate.js +3 -20
- package/dist/pipeline/head-tail/integration/tail-assembly.d.ts +2 -3
- package/dist/pipeline/head-tail/integration/tail-assembly.js +20 -145
- package/dist/pipeline/head-tail/lifecycle/commit-context.d.ts +1 -1
- package/dist/pipeline/head-tail/lifecycle/head-tail-render-plan.d.ts +1 -1
- package/dist/pipeline/head-tail/lifecycle/hooks.d.ts +2 -3
- package/dist/pipeline/head-tail/lifecycle/hooks.js +0 -9
- package/dist/pipeline/head-tail/lifecycle/plan-context.d.ts +1 -1
- package/dist/pipeline/head-tail/lifecycle/plan-context.js +1 -1
- package/dist/pipeline/head-tail/lifecycle/registry.d.ts +3 -4
- package/dist/pipeline/head-tail/lifecycle/registry.js +1 -4
- package/dist/pipeline/head-tail/lifecycle/render.js +2 -2
- package/dist/pipeline/head-tail/line-memo.d.ts +1 -1
- package/dist/pipeline/head-tail/line-memo.js +25 -6
- package/dist/pipeline/head-tail/tail/chain.d.ts +3 -3
- package/dist/pipeline/head-tail/tail/families/tokoro-semantics.d.ts +0 -1
- package/dist/pipeline/head-tail/tail/families/tokoro-semantics.js +2 -1
- package/dist/pipeline/head-tail/tail/families/youda-semantics.js +1 -4
- package/dist/pipeline/head-tail/tail/postverb-events.d.ts +0 -180
- package/dist/pipeline/head-tail/tail/postverb-events.js +2 -2249
- package/dist/pipeline/head-tail/tail/postverb-tail-classifier.js +3 -4
- package/dist/pipeline/head-tail/tail/predicate-root/aspect-semantics.d.ts +10 -8
- package/dist/pipeline/head-tail/tail/predicate-root/aspect-semantics.js +2 -55
- package/dist/pipeline/head-tail/tail/predicate-root/benefactive-hydration.d.ts +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/benefactive-hydration.js +1 -18
- package/dist/pipeline/head-tail/tail/predicate-root/boundary-semantics.js +4 -2
- package/dist/pipeline/head-tail/tail/predicate-root/classifiers/causative-aux.d.ts +4 -0
- package/dist/pipeline/head-tail/tail/predicate-root/classifiers/causative-aux.js +11 -0
- package/dist/pipeline/head-tail/tail/predicate-root/classifiers/copula-concessive.d.ts +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/classifiers/copula-concessive.js +14 -3
- package/dist/pipeline/head-tail/tail/predicate-root/classifiers/tokens.d.ts +0 -2
- package/dist/pipeline/head-tail/tail/predicate-root/classifiers/tokens.js +3 -12
- package/dist/pipeline/head-tail/tail/predicate-root/commit.d.ts +2 -1
- package/dist/pipeline/head-tail/tail/predicate-root/commit.js +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/commitment-bridge.d.ts +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/connective-ops.d.ts +9 -0
- package/dist/pipeline/head-tail/tail/predicate-root/connective-ops.js +69 -0
- package/dist/pipeline/head-tail/tail/predicate-root/connective-render.d.ts +7 -0
- package/dist/pipeline/head-tail/tail/predicate-root/connective-render.js +52 -0
- package/dist/pipeline/head-tail/tail/predicate-root/connective-surface-lookup.d.ts +11 -0
- package/dist/pipeline/head-tail/tail/predicate-root/connective-surface-lookup.js +114 -0
- package/dist/pipeline/head-tail/tail/predicate-root/derivational-host-base.js +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/grammar.d.ts +2 -14
- package/dist/pipeline/head-tail/tail/predicate-root/grammar.js +19 -128
- package/dist/pipeline/head-tail/tail/predicate-root/head-contract-table.d.ts +2 -1
- package/dist/pipeline/head-tail/tail/predicate-root/head-contract-table.js +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/head-hydration.js +2 -17
- package/dist/pipeline/head-tail/tail/predicate-root/inspect.d.ts +2 -8
- package/dist/pipeline/head-tail/tail/predicate-root/inspect.js +12 -16
- package/dist/pipeline/head-tail/tail/predicate-root/integration/attributive-boundary.d.ts +35 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/attributive-boundary.js +1079 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/clause-boundaries.d.ts +69 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/clause-boundaries.js +2972 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/contracts.d.ts +118 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/end-boundary-inference.d.ts +22 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/end-boundary-inference.js +698 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/head-admission.d.ts +39 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/head-admission.js +689 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/head-profiles.d.ts +13 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/head-profiles.js +138 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/parse-clause.d.ts +60 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/parse-clause.js +2013 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/predicate-evidence.d.ts +15 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/predicate-evidence.js +109 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/predicate-start-evidence.d.ts +48 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/predicate-start-evidence.js +608 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/readiness.d.ts +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/integration/readiness.js +3 -2
- package/dist/pipeline/head-tail/tail/predicate-root/integration/stem-candidates.d.ts +177 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/stem-candidates.js +1885 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/tail-arbitration.d.ts +13 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/tail-arbitration.js +283 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/tail-chunk-scan-end.d.ts +8 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/tail-chunk-scan-end.js +389 -0
- package/dist/pipeline/head-tail/tail/predicate-root/integration/zero-head.js +3 -2
- package/dist/pipeline/head-tail/tail/predicate-root/integration.d.ts +9 -166
- package/dist/pipeline/head-tail/tail/predicate-root/integration.js +254 -10644
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/connective-tail.d.ts +51 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/connective-tail.js +808 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/connective.d.ts +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/connective.js +5 -3
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/copula-tail.d.ts +22 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/copula-tail.js +156 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/copula.d.ts +8 -2
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/copula.js +177 -51
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/lexical-idioms.d.ts +37 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/lexical-idioms.js +959 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/likeness-modal.d.ts +15 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/likeness-modal.js +327 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/modal-tail.d.ts +44 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/modal-tail.js +998 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/obligation-tail.d.ts +20 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/obligation-tail.js +424 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/obligation.d.ts +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/obligation.js +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/postverb-operator.d.ts +25 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/postverb-operator.js +722 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/predicate-projection-connective.js +143 -9
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/predicate-quote.d.ts +44 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/predicate-quote.js +856 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/projection-tail.d.ts +45 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/projection-tail.js +573 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/quantity-extent.d.ts +2 -1
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/quantity-extent.js +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/te-aspect.d.ts +23 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/te-aspect.js +598 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/te-host.d.ts +11 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/te-host.js +52 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/terminal-sfp.d.ts +24 -0
- package/dist/pipeline/head-tail/tail/predicate-root/matchers/terminal-sfp.js +873 -0
- package/dist/pipeline/head-tail/tail/predicate-root/mid-chain-connective-license.js +2 -1
- package/dist/pipeline/head-tail/tail/predicate-root/nominal-host-phrase.d.ts +0 -1
- package/dist/pipeline/head-tail/tail/predicate-root/nominal-host-phrase.js +0 -3
- package/dist/pipeline/head-tail/tail/predicate-root/op-builders.d.ts +5 -1
- package/dist/pipeline/head-tail/tail/predicate-root/op-builders.js +21 -0
- package/dist/pipeline/head-tail/tail/predicate-root/operator-head.d.ts +1 -3
- package/dist/pipeline/head-tail/tail/predicate-root/operator-head.js +0 -16
- package/dist/pipeline/head-tail/tail/predicate-root/parse-boundary-hint.d.ts +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/parse-closure.d.ts +15 -0
- package/dist/pipeline/head-tail/tail/predicate-root/parse-closure.js +158 -0
- package/dist/pipeline/head-tail/tail/predicate-root/parse-coordinates.d.ts +10 -0
- package/dist/pipeline/head-tail/tail/predicate-root/parse-coordinates.js +29 -0
- package/dist/pipeline/head-tail/tail/predicate-root/parse-stem.d.ts +14 -0
- package/dist/pipeline/head-tail/tail/predicate-root/parse-stem.js +150 -0
- package/dist/pipeline/head-tail/tail/predicate-root/parse-tail.d.ts +40 -0
- package/dist/pipeline/head-tail/tail/predicate-root/parse-tail.js +1625 -0
- package/dist/pipeline/head-tail/tail/predicate-root/parser.d.ts +26 -137
- package/dist/pipeline/head-tail/tail/predicate-root/parser.js +153 -9225
- package/dist/pipeline/head-tail/tail/predicate-root/plan-lifecycle.d.ts +2 -2
- package/dist/pipeline/head-tail/tail/predicate-root/postverb-host-attachment.d.ts +8 -0
- package/dist/pipeline/head-tail/tail/predicate-root/postverb-host-attachment.js +105 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-admission-contract.js +261 -215
- package/dist/pipeline/head-tail/tail/predicate-root/production-claim-access.d.ts +0 -1
- package/dist/pipeline/head-tail/tail/predicate-root/production-claim-access.js +0 -3
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/attributive-change.d.ts +3 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/attributive-change.js +327 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/attributive.d.ts +54 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/attributive.js +1212 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/chain-patterns.d.ts +191 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/chain-patterns.js +127 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/clause-chain.d.ts +17 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/clause-chain.js +1071 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/conditional-carriers.d.ts +4 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/conditional-carriers.js +366 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/confirmation.d.ts +3 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/confirmation.js +289 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/copula.d.ts +8 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/copula.js +868 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/desiderative.d.ts +4 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/desiderative.js +414 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/exemplification.d.ts +2 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/exemplification.js +290 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/imperative.d.ts +6 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/imperative.js +468 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/mid-chain-quote.d.ts +4 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/mid-chain-quote.js +558 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/nominalization.d.ts +6 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/nominalization.js +332 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/nominalized-quote.d.ts +3 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/nominalized-quote.js +393 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/normalization.d.ts +7 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/normalization.js +334 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/potential.d.ts +3 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/potential.js +304 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/reason-and-sequence.d.ts +6 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/reason-and-sequence.js +687 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/request.d.ts +4 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/request.js +1013 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/shared.d.ts +25 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/shared.js +53 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/subordination.d.ts +5 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/subordination.js +318 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/terminal.d.ts +14 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/terminal.js +976 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/volitional.d.ts +10 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families/volitional.js +677 -0
- package/dist/pipeline/head-tail/tail/predicate-root/production-families.d.ts +1 -8
- package/dist/pipeline/head-tail/tail/predicate-root/production-families.js +19 -11025
- package/dist/pipeline/head-tail/tail/predicate-root/production-lowering-bindings.js +9 -3
- package/dist/pipeline/head-tail/tail/predicate-root/production-registry.d.ts +2 -3
- package/dist/pipeline/head-tail/tail/predicate-root/production-registry.js +15 -19
- package/dist/pipeline/head-tail/tail/predicate-root/quote-tail-context.d.ts +8 -0
- package/dist/pipeline/head-tail/tail/predicate-root/quote-tail-context.js +66 -0
- package/dist/pipeline/head-tail/tail/predicate-root/render-derivational-host-projection.d.ts +11 -0
- package/dist/pipeline/head-tail/tail/predicate-root/render-derivational-host-projection.js +67 -0
- package/dist/pipeline/head-tail/tail/predicate-root/render-root.d.ts +10 -0
- package/dist/pipeline/head-tail/tail/predicate-root/render-root.js +203 -0
- package/dist/pipeline/head-tail/tail/predicate-root/render-sfp-terminal.d.ts +3 -0
- package/dist/pipeline/head-tail/tail/predicate-root/render-sfp-terminal.js +647 -0
- package/dist/pipeline/head-tail/tail/predicate-root/render.d.ts +9 -25
- package/dist/pipeline/head-tail/tail/predicate-root/render.js +715 -5879
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/aspect-bases.d.ts +23 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/aspect-bases.js +523 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/aspect-benefactive.js +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/attributive-tail-forms.d.ts +71 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/attributive-tail-forms.js +907 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/aux-layer-context.d.ts +48 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/aux-layer-context.js +1 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/base-model.d.ts +3 -1
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/base-model.js +35 -1
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/base-support.d.ts +8 -1
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/base-support.js +90 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/command-render.d.ts +1 -13
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/command-render.js +3 -10
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/command-tail.d.ts +17 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/command-tail.js +439 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/conjecture-compose.d.ts +34 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/conjecture-compose.js +358 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/connective-compose.d.ts +2 -120
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/connective-compose.js +90 -1670
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/connective-ending.d.ts +7 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/connective-ending.js +36 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/continuative-copula.d.ts +7 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/continuative-copula.js +61 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/desire-bases.d.ts +9 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/desire-bases.js +69 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/hostless-conditional-quote.d.ts +12 -2
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/hostless-conditional-quote.js +19 -1
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/idiom-bases.d.ts +119 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/idiom-bases.js +393 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/modal-bases.d.ts +77 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/modal-bases.js +1243 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/non-chain-tail.d.ts +3 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/non-chain-tail.js +1045 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/noun-copula-attributive-forms.d.ts +38 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/noun-copula-attributive-forms.js +507 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/noun-copula-conjecture-compose.d.ts +5 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/noun-copula-conjecture-compose.js +108 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/noun-copula-tail-forms.d.ts +72 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/noun-copula-tail-forms.js +1343 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/noun-copula.js +9 -3
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/op-chain.js +1229 -1107
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/operator-chain-tail.d.ts +23 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/operator-chain-tail.js +443 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/postverb-auxiliary-bases.d.ts +12 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/postverb-auxiliary-bases.js +1193 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/predicate-base-projection.d.ts +18 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/predicate-base-projection.js +284 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/predicate-bases.d.ts +3 -271
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/predicate-bases.js +438 -5062
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/predicate-terminal-compose.d.ts +10 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/predicate-terminal-compose.js +167 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/purpose-manner-compose.d.ts +9 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/purpose-manner-compose.js +92 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/quote-complement-compose.d.ts +53 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/quote-complement-compose.js +534 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/reason-quote-carrier.js +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/scope-bridge-bases.d.ts +5 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/scope-bridge-bases.js +571 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/sequence-after-copula.js +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/sfp-question.d.ts +2 -1
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/sfp-question.js +9 -12
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/tail-host-trace.d.ts +15 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/tail-host-trace.js +134 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/voice-benefactive-bases.d.ts +41 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/voice-benefactive-bases.js +648 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/voice-benefactive-tail.d.ts +12 -0
- package/dist/pipeline/head-tail/tail/predicate-root/renderers/voice-benefactive-tail.js +306 -0
- package/dist/pipeline/head-tail/tail/predicate-root/span-provenance.d.ts +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/suffix-handoff.d.ts +0 -1
- package/dist/pipeline/head-tail/tail/predicate-root/suffix-handoff.js +0 -13
- package/dist/pipeline/head-tail/tail/predicate-root/tail-evidence-decision.d.ts +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/tail-evidence-decision.js +5 -45
- package/dist/pipeline/head-tail/tail/predicate-root/tame-reason-evidence.d.ts +8 -1
- package/dist/pipeline/head-tail/tail/predicate-root/tame-reason-evidence.js +15 -0
- package/dist/pipeline/head-tail/tail/predicate-root/trace.d.ts +1 -1
- package/dist/pipeline/head-tail/tail/predicate-root/trace.js +2 -1
- package/dist/pipeline/head-tail/tail/segments/nominal-frame.d.ts +1 -1
- package/dist/pipeline/head-tail/tail/te-tail-continuation-table.js +1 -3
- package/dist/pipeline/index.d.ts +0 -4
- package/dist/pipeline/lexical-nominal-head-claims.d.ts +1 -1
- package/dist/pipeline/lexical-particle-boundary-claims.d.ts +1 -1
- package/dist/pipeline/lexical-renyou-head-claims.d.ts +1 -1
- package/dist/pipeline/lexical-renyou-head-claims.js +1 -1
- package/dist/pipeline/lookup-tables.d.ts +1 -0
- package/dist/pipeline/lookup-tables.js +1 -0
- package/dist/pipeline/matchers.d.ts +0 -3
- package/dist/pipeline/matchers.js +1 -8
- package/dist/pipeline/particle-head-dispatch.d.ts +1 -1
- package/dist/pipeline/particle-head-dispatch.js +472 -442
- package/dist/pipeline/particles/index.d.ts +3 -3
- package/dist/pipeline/particles/secondary-particle.d.ts +1 -0
- package/dist/pipeline/particles/secondary-particle.js +4 -0
- package/dist/pipeline/pattern-runtime.d.ts +0 -61
- package/dist/pipeline/pattern-runtime.js +3 -684
- package/dist/pipeline/preprocess/analyzer-input-offsets.d.ts +5 -0
- package/dist/pipeline/preprocess/analyzer-input-offsets.js +23 -0
- package/dist/pipeline/preprocess/auxiliary-variant-retag.d.ts +7 -0
- package/dist/pipeline/preprocess/auxiliary-variant-retag.js +178 -0
- package/dist/pipeline/preprocess/bungo-nasal-n-retag.d.ts +9 -0
- package/dist/pipeline/preprocess/bungo-nasal-n-retag.js +318 -0
- package/dist/pipeline/preprocess/cat-meow.d.ts +4 -0
- package/dist/pipeline/preprocess/cat-meow.js +46 -0
- package/dist/pipeline/preprocess/causative-aux-lemma.d.ts +2 -0
- package/dist/pipeline/preprocess/causative-aux-lemma.js +10 -0
- package/dist/pipeline/preprocess/collapsed-aspect-aux.d.ts +3 -0
- package/dist/pipeline/preprocess/collapsed-aspect-aux.js +217 -0
- package/dist/pipeline/preprocess/collapsed-te-oku.d.ts +3 -0
- package/dist/pipeline/preprocess/collapsed-te-oku.js +210 -0
- package/dist/pipeline/preprocess/collocation-emission.d.ts +14 -0
- package/dist/pipeline/preprocess/collocation-emission.js +148 -0
- package/dist/pipeline/preprocess/colloquial-vowel-fusion.d.ts +4 -0
- package/dist/pipeline/preprocess/colloquial-vowel-fusion.js +164 -0
- package/dist/{transform → pipeline/preprocess}/compound-particle-merge.d.ts +2 -2
- package/dist/{transform → pipeline/preprocess}/compound-particle-merge.js +5 -5
- package/dist/pipeline/preprocess/copula-focus-negative-state-change.d.ts +3 -0
- package/dist/pipeline/preprocess/copula-focus-negative-state-change.js +79 -0
- package/dist/pipeline/preprocess/copula-renyou-retag.d.ts +3 -0
- package/dist/pipeline/preprocess/copula-renyou-retag.js +56 -0
- package/dist/pipeline/preprocess/emphasis-sokuon.d.ts +10 -0
- package/dist/pipeline/preprocess/emphasis-sokuon.js +182 -0
- package/dist/{transform → pipeline/preprocess}/explanatory-mon-sfp-retag.d.ts +1 -1
- package/dist/{transform → pipeline/preprocess}/explanatory-mon-sfp-retag.js +2 -2
- package/dist/pipeline/preprocess/follower-context.d.ts +7 -0
- package/dist/pipeline/preprocess/follower-context.js +33 -0
- package/dist/pipeline/preprocess/fused-conditional.d.ts +3 -0
- package/dist/pipeline/preprocess/fused-conditional.js +97 -0
- package/dist/pipeline/preprocess/imperative-mistag-recovery.d.ts +7 -0
- package/dist/pipeline/preprocess/imperative-mistag-recovery.js +135 -0
- package/dist/pipeline/preprocess/input-text-normalization.d.ts +3 -0
- package/dist/pipeline/preprocess/input-text-normalization.js +39 -0
- package/dist/pipeline/preprocess/kansai-dialect.d.ts +9 -0
- package/dist/pipeline/preprocess/kansai-dialect.js +501 -0
- package/dist/{transform → pipeline/preprocess}/keijouji-copula-de-retag.d.ts +1 -1
- package/dist/{transform → pipeline/preprocess}/keijouji-copula-de-retag.js +2 -2
- package/dist/{transform → pipeline/preprocess}/ni-complement-matrix-flip.d.ts +1 -1
- package/dist/{transform → pipeline/preprocess}/ni-complement-matrix-flip.js +2 -2
- package/dist/pipeline/preprocess/past-quotative-tte-resplit.d.ts +3 -0
- package/dist/pipeline/preprocess/past-quotative-tte-resplit.js +55 -0
- package/dist/pipeline/preprocess/prolonged-orthography.d.ts +5 -0
- package/dist/pipeline/preprocess/prolonged-orthography.js +79 -0
- package/dist/pipeline/preprocess/prolonged-surface-canonicalization.d.ts +5 -0
- package/dist/pipeline/preprocess/prolonged-surface-canonicalization.js +161 -0
- package/dist/pipeline/preprocess/punctuation-canonicalization.d.ts +5 -0
- package/dist/pipeline/preprocess/punctuation-canonicalization.js +160 -0
- package/dist/{transform → pipeline/preprocess}/quotative-manner-noun-flip.d.ts +2 -2
- package/dist/{transform → pipeline/preprocess}/quotative-manner-noun-flip.js +10 -10
- package/dist/{transform → pipeline/preprocess}/reduplicated-mimetic.d.ts +1 -1
- package/dist/{transform → pipeline/preprocess}/reduplicated-mimetic.js +3 -3
- package/dist/{transform → pipeline/preprocess}/rentaishi-no-nominalizer-retag.d.ts +1 -1
- package/dist/{transform → pipeline/preprocess}/rentaishi-no-nominalizer-retag.js +2 -2
- package/dist/pipeline/preprocess/runtime-token-from-analyzer.d.ts +5 -0
- package/dist/pipeline/preprocess/runtime-token-from-analyzer.js +77 -0
- package/dist/pipeline/preprocess/runtime-token-from-preprocess.d.ts +13 -0
- package/dist/pipeline/preprocess/runtime-token-from-preprocess.js +15 -0
- package/dist/pipeline/preprocess/standalone-voice-mark.d.ts +9 -0
- package/dist/pipeline/preprocess/standalone-voice-mark.js +73 -0
- package/dist/pipeline/preprocess/synthetic-token.d.ts +10 -0
- package/dist/pipeline/preprocess/synthetic-token.js +26 -0
- package/dist/pipeline/preprocess/te-contraction.d.ts +4 -0
- package/dist/pipeline/preprocess/te-contraction.js +150 -0
- package/dist/pipeline/preprocess/terminal-role-tail.d.ts +5 -0
- package/dist/pipeline/preprocess/terminal-role-tail.js +148 -0
- package/dist/{transform → pipeline/preprocess}/terminal-sfp-retag-closure.d.ts +2 -2
- package/dist/{transform → pipeline/preprocess}/terminal-sfp-retag-closure.js +4 -4
- package/dist/pipeline/preprocess/to-iu-contraction.d.ts +2 -0
- package/dist/pipeline/preprocess/to-iu-contraction.js +65 -0
- package/dist/{transform → pipeline/preprocess}/volitional-resolution-sfp-retag.d.ts +1 -1
- package/dist/{transform → pipeline/preprocess}/volitional-resolution-sfp-retag.js +2 -2
- package/dist/{transform → pipeline/preprocess}/youon-remerge.d.ts +1 -1
- package/dist/{transform → pipeline/preprocess}/youon-remerge.js +3 -3
- package/dist/pipeline/projection/narou-ruby-input.d.ts +17 -0
- package/dist/pipeline/projection/narou-ruby-input.js +149 -0
- package/dist/pipeline/projection/parenthetical-delimiter-annotation.d.ts +6 -0
- package/dist/pipeline/projection/parenthetical-delimiter-annotation.js +117 -0
- package/dist/pipeline/projection/parenthetical-ruby-absorption.d.ts +6 -0
- package/dist/pipeline/projection/parenthetical-ruby-absorption.js +198 -0
- package/dist/pipeline/projection/parenthetical-source-boundary.d.ts +12 -0
- package/dist/pipeline/projection/parenthetical-source-boundary.js +117 -0
- package/dist/pipeline/projection/parenthetical-source-identity.d.ts +14 -0
- package/dist/pipeline/projection/parenthetical-source-identity.js +443 -0
- package/dist/pipeline/projection/parenthetical-target-insertion.d.ts +22 -0
- package/dist/pipeline/projection/parenthetical-target-insertion.js +584 -0
- package/dist/pipeline/projection/prepared-translation.d.ts +52 -0
- package/dist/pipeline/projection/prepared-translation.js +1 -0
- package/dist/pipeline/projection/prepared-tree.d.ts +6 -0
- package/dist/pipeline/projection/prepared-tree.js +66 -0
- package/dist/pipeline/projection/raw-parenthetical-split.d.ts +15 -0
- package/dist/pipeline/projection/raw-parenthetical-split.js +78 -0
- package/dist/pipeline/projection/ruby-annotation.d.ts +5 -0
- package/dist/pipeline/projection/ruby-annotation.js +161 -0
- package/dist/pipeline/projection/text-offset-projection.d.ts +7 -0
- package/dist/pipeline/projection/text-offset-projection.js +111 -0
- package/dist/pipeline/projection/transparent-pause-island.d.ts +8 -0
- package/dist/pipeline/projection/transparent-pause-island.js +188 -0
- package/dist/pipeline/pronominal-no-dispatch.js +1 -1
- package/dist/pipeline/quote/host-runtime.js +3 -2
- package/dist/pipeline/quote/host-taxonomy.d.ts +1 -0
- package/dist/pipeline/quote/host-taxonomy.js +2 -2
- package/dist/pipeline/quote/question-taking-enumeration.d.ts +1 -1
- package/dist/pipeline/quote/question-taking-enumeration.js +0 -4
- package/dist/pipeline/reason-source-evidence.d.ts +1 -0
- package/dist/pipeline/reason-source-evidence.js +1 -1
- package/dist/pipeline/rendering/functional-chain.d.ts +2 -0
- package/dist/pipeline/rendering/functional-chain.js +14 -0
- package/dist/pipeline/rendering/nominal-head-tail-plan-trace.d.ts +10 -0
- package/dist/pipeline/rendering/nominal-head-tail-plan-trace.js +336 -0
- package/dist/pipeline/rendering/render-plan-inspect.d.ts +9 -0
- package/dist/pipeline/rendering/render-plan-inspect.js +121 -0
- package/dist/pipeline/rendering/render-plan-payloads.d.ts +28 -0
- package/dist/pipeline/rendering/render-plan-payloads.js +125 -0
- package/dist/pipeline/rendering/render-plan-rewrite.d.ts +32 -0
- package/dist/pipeline/rendering/render-plan-rewrite.js +540 -0
- package/dist/pipeline/rendering/render-plan-segments.d.ts +42 -0
- package/dist/pipeline/rendering/render-plan-segments.js +263 -0
- package/dist/pipeline/rendering/render-plan.d.ts +4 -57
- package/dist/pipeline/rendering/render-plan.js +52 -1433
- package/dist/pipeline/rendering/request-normalization.d.ts +0 -1
- package/dist/pipeline/rendering/request-normalization.js +0 -3
- package/dist/pipeline/rendering/segment-allomorph.d.ts +17 -0
- package/dist/pipeline/rendering/segment-allomorph.js +152 -0
- package/dist/pipeline/rendering/segment-annotation-keys.d.ts +6 -0
- package/dist/pipeline/rendering/segment-annotation-keys.js +137 -0
- package/dist/pipeline/rendering/stem-derivation.js +1 -1
- package/dist/pipeline/rendering/target-segment-build.d.ts +13 -0
- package/dist/pipeline/rendering/target-segment-build.js +167 -0
- package/dist/pipeline/rendering/terminal-unit-punctuation.d.ts +16 -0
- package/dist/pipeline/rendering/terminal-unit-punctuation.js +96 -0
- package/dist/pipeline/rendering/unit-surface.d.ts +9 -0
- package/dist/pipeline/rendering/unit-surface.js +35 -0
- package/dist/pipeline/resource-cache.d.ts +19 -0
- package/dist/pipeline/resource-cache.js +164 -0
- package/dist/pipeline/rules/common.d.ts +0 -1
- package/dist/pipeline/rules/common.js +0 -1
- package/dist/pipeline/rules/entry-aux.d.ts +0 -2
- package/dist/pipeline/rules/entry-aux.js +0 -4
- package/dist/pipeline/rules/postaux-unsupported.js +1 -5
- package/dist/pipeline/rules/pre-entry.d.ts +0 -1
- package/dist/pipeline/rules/pre-entry.js +0 -1
- package/dist/pipeline/rules/tail-finalization.js +4 -5
- package/dist/pipeline/semantics/conditional.d.ts +2 -1
- package/dist/pipeline/semantics/conditional.js +3 -2
- package/dist/pipeline/semantics/copula-tail-runtime.js +2 -2
- package/dist/pipeline/semantics/explanatory-mon-reading.d.ts +1 -1
- package/dist/pipeline/semantics/explanatory-mon-reading.js +2 -2
- package/dist/pipeline/semantics/extent-phrase.js +1 -1
- package/dist/pipeline/semantics/frame.d.ts +3 -3
- package/dist/pipeline/semantics/frame.js +4 -4
- package/dist/pipeline/semantics/gano-conversion.d.ts +1 -2
- package/dist/pipeline/semantics/gano-conversion.js +1 -9
- package/dist/pipeline/semantics/grammar-runtime.d.ts +0 -7
- package/dist/pipeline/semantics/grammar-runtime.js +0 -92
- package/dist/pipeline/semantics/honorific.d.ts +1 -2
- package/dist/pipeline/semantics/honorific.js +0 -3
- package/dist/pipeline/semantics/mono-modal.d.ts +1 -1
- package/dist/pipeline/semantics/numeric.js +1 -3
- package/dist/pipeline/semantics/sfp-surface.js +8 -0
- package/dist/pipeline/source-candidate-set.d.ts +1 -2
- package/dist/pipeline/source-candidate-set.js +0 -3
- package/dist/pipeline/source-coordinate.d.ts +20 -0
- package/dist/pipeline/source-coordinate.js +42 -0
- package/dist/pipeline/structural-relation/clause-connective-relations.d.ts +12 -0
- package/dist/pipeline/structural-relation/clause-connective-relations.js +327 -0
- package/dist/pipeline/structural-relation/collect.d.ts +1 -12
- package/dist/pipeline/structural-relation/collect.js +11 -3105
- package/dist/pipeline/structural-relation/connective-relation-match.d.ts +17 -0
- package/dist/pipeline/structural-relation/connective-relation-match.js +39 -0
- package/dist/pipeline/structural-relation/diagnostics.d.ts +0 -2
- package/dist/pipeline/structural-relation/diagnostics.js +0 -7
- package/dist/pipeline/structural-relation/ka-parallel-relations.d.ts +3 -0
- package/dist/pipeline/structural-relation/ka-parallel-relations.js +695 -0
- package/dist/pipeline/structural-relation/nari-relations.d.ts +3 -0
- package/dist/pipeline/structural-relation/nari-relations.js +367 -0
- package/dist/pipeline/structural-relation/parallel-item-evidence.d.ts +12 -0
- package/dist/pipeline/structural-relation/parallel-item-evidence.js +73 -0
- package/dist/pipeline/structural-relation/punctuated-attributive-relations.d.ts +2 -0
- package/dist/pipeline/structural-relation/punctuated-attributive-relations.js +224 -0
- package/dist/pipeline/structural-relation/purpose-relations.d.ts +7 -0
- package/dist/pipeline/structural-relation/purpose-relations.js +306 -0
- package/dist/pipeline/structural-relation/quote-clause-boundary.d.ts +47 -0
- package/dist/pipeline/structural-relation/quote-clause-boundary.js +216 -0
- package/dist/pipeline/structural-relation/quote-closed-toka.d.ts +22 -0
- package/dist/pipeline/structural-relation/quote-closed-toka.js +158 -0
- package/dist/pipeline/structural-relation/quote-content-endings.d.ts +20 -0
- package/dist/pipeline/structural-relation/quote-content-endings.js +163 -0
- package/dist/pipeline/structural-relation/quote-content-span.d.ts +23 -0
- package/dist/pipeline/structural-relation/quote-content-span.js +270 -0
- package/dist/pipeline/structural-relation/quote-nominal-and-passive.d.ts +22 -0
- package/dist/pipeline/structural-relation/quote-nominal-and-passive.js +724 -0
- package/dist/pipeline/structural-relation/quote-payload.d.ts +33 -0
- package/dist/pipeline/structural-relation/quote-payload.js +137 -0
- package/dist/pipeline/structural-relation/quote-question-content.d.ts +18 -0
- package/dist/pipeline/structural-relation/quote-question-content.js +588 -0
- package/dist/pipeline/structural-relation/quote-reason-copula.d.ts +18 -0
- package/dist/pipeline/structural-relation/quote-reason-copula.js +84 -0
- package/dist/pipeline/structural-relation/quote-relation-enrichment.d.ts +4 -0
- package/dist/pipeline/structural-relation/quote-relation-enrichment.js +174 -0
- package/dist/pipeline/structural-relation/quote-request.d.ts +16 -0
- package/dist/pipeline/structural-relation/quote-request.js +249 -0
- package/dist/pipeline/structural-relation/quote.d.ts +4 -130
- package/dist/pipeline/structural-relation/quote.js +105 -2627
- package/dist/pipeline/structural-relation/reason-relations.d.ts +6 -0
- package/dist/pipeline/structural-relation/reason-relations.js +328 -0
- package/dist/pipeline/structural-relation/relation-coordinates.d.ts +21 -0
- package/dist/pipeline/structural-relation/relation-coordinates.js +110 -0
- package/dist/pipeline/structural-relation/render-attributive.d.ts +25 -0
- package/dist/pipeline/structural-relation/render-attributive.js +195 -0
- package/dist/pipeline/structural-relation/render-clause-connective.d.ts +29 -0
- package/dist/pipeline/structural-relation/render-clause-connective.js +114 -0
- package/dist/pipeline/structural-relation/render-connective-plan.d.ts +28 -0
- package/dist/pipeline/structural-relation/render-connective-plan.js +164 -0
- package/dist/pipeline/structural-relation/render-parallel.d.ts +60 -0
- package/dist/pipeline/structural-relation/render-parallel.js +1088 -0
- package/dist/pipeline/structural-relation/render-quote.d.ts +75 -0
- package/dist/pipeline/structural-relation/render-quote.js +968 -0
- package/dist/pipeline/structural-relation/render-reason-copula.d.ts +24 -0
- package/dist/pipeline/structural-relation/render-reason-copula.js +324 -0
- package/dist/pipeline/structural-relation/render-source-sequence.d.ts +11 -0
- package/dist/pipeline/structural-relation/render-source-sequence.js +154 -0
- package/dist/pipeline/structural-relation/render-unit-spans.d.ts +35 -0
- package/dist/pipeline/structural-relation/render-unit-spans.js +71 -0
- package/dist/pipeline/structural-relation/render.d.ts +2 -25
- package/dist/pipeline/structural-relation/render.js +10 -3043
- package/dist/pipeline/structural-relation/source-predicate-operator.d.ts +2 -1
- package/dist/pipeline/structural-relation/tari-listing-relations.d.ts +5 -0
- package/dist/pipeline/structural-relation/tari-listing-relations.js +354 -0
- package/dist/pipeline/structural-relation/toka-nominal-listing-relations.d.ts +2 -0
- package/dist/pipeline/structural-relation/toka-nominal-listing-relations.js +154 -0
- package/dist/pipeline/structural-relation/toka-nominal-listing-run.d.ts +11 -1
- package/dist/pipeline/structural-relation/toka-nominal-listing-run.js +16 -4
- package/dist/pipeline/structural-relation/types.d.ts +10 -1
- package/dist/pipeline/translation/access.d.ts +0 -3
- package/dist/pipeline/translation/unit.d.ts +4 -1
- package/dist/pipeline/translation/unit.js +29 -9
- package/dist/pipeline/translation/warnings.d.ts +9 -0
- package/dist/pipeline/translation/warnings.js +251 -0
- package/dist/pipeline-factory.js +2 -1
- package/dist/scripts/diagnose.js +3 -2
- package/dist/types/pos.d.ts +3 -0
- package/dist/types/pos.js +8 -0
- package/dist/types/reanalysis.d.ts +0 -1
- package/dist/types/reanalysis.js +0 -1
- package/dist/types/render-plan.d.ts +1 -2
- package/dist/utils/char-class.d.ts +2 -0
- package/dist/utils/char-class.js +6 -0
- package/dist/utils/record.d.ts +1 -0
- package/dist/utils/record.js +3 -0
- package/dist/webext-provider.d.ts +7 -0
- package/dist/webext-provider.js +56 -16
- package/package.json +1 -1
- package/dist/pipeline/head-tail/audit/types.d.ts +0 -7
- /package/dist/pipeline/head-tail/{audit/types.js → tail/predicate-root/integration/contracts.js} +0 -0
|
@@ -0,0 +1,1625 @@
|
|
|
1
|
+
import { isAdjNai } from "../../../matchers.js";
|
|
2
|
+
import { TokenCursor } from "../../../token-cursor.js";
|
|
3
|
+
import { YOU_NI_VOLITIONAL_MANNER_HOSTS } from "../../data/semantic-helper-sets.js";
|
|
4
|
+
import { tariKeijoujiAdverbialToEvidence } from "../../../semantics/tari-adverbial-marker.js";
|
|
5
|
+
import { tosuruResultativeMakeYieldsToAttributiveQuoteHead } from "./tosuru-construction-mode.js";
|
|
6
|
+
import { previousNonSpaceIndex } from "../../../clause-layout/trivia.js";
|
|
7
|
+
import { conditionalQuoteEllipsisClassForSurface } from "./connective-render-table.js";
|
|
8
|
+
import { sourceVerbalPredicateAfterAuxOp } from "./operator-head.js";
|
|
9
|
+
import { isTeConnectiveToken, teDeContinuationRelationAt } from "../postverb-tail-classifier.js";
|
|
10
|
+
import { retrospectiveQuotativeFlavorForStemMood } from "./grammar.js";
|
|
11
|
+
import { lookupConnectiveBySurface, connectiveSurfaceRequiresFinalPosition } from "./connective-surface-lookup.js";
|
|
12
|
+
import { canOpenMalformedConditionalFragmentTerminal, canOpenRenyouChuushiTerminal, canOpenStemMalformedConditionalFragmentTerminal, canOpenStemRenyouChuushiTerminal, canOpenOpsRenyouCompoundPrenominalTerminal, canOpenStemRenyouCompoundPrenominalTerminal, missingConditionalMarkerConnective, renyouChuushiPayloadForOp, renyouChuushiPayloadForSource } from "./fragment-recovery.js";
|
|
13
|
+
import { declaredProjectionCarrierBranchTerminal } from "./projection-carrier-form-table.js";
|
|
14
|
+
import { srcSingle, srcSlice } from "./source.js";
|
|
15
|
+
import { isNaiOrNuToken, isSyntheticDeicticStemToken } from "./classifiers/tokens.js";
|
|
16
|
+
import { tailOpsEndInPastTense } from "./matchers/tokoro-result-connective.js";
|
|
17
|
+
import { tryMatchObligation } from "./matchers/obligation.js";
|
|
18
|
+
import { matchNegationEnding } from "./matchers/negation-ending.js";
|
|
19
|
+
import { matchGotokuMannerSimileConnectiveAt, matchKaNoYouNiMannerSimileConnectiveAt } from "./matchers/predicate-projection-connective.js";
|
|
20
|
+
import { matchElidedNominalizerScopeBridge, matchImplicitNegativeFocusBridge, matchScopeBridge, matchScopeBridgeBeforeBasicCopula } from "./matchers/scope-bridge.js";
|
|
21
|
+
import { applyNominalHostQuoteDecoration, skipHostEnclosingQuoteClose } from "./nominal-host-phrase.js";
|
|
22
|
+
import { firstAuxLayer, stemHasSourceVerbalPredicateEvidence } from "./inspect.js";
|
|
23
|
+
import { POS4, POS5, POS5A, posToString, 仮定形_, 助動詞_ジャ, 助動詞_ダ, 助動詞_デス, 助動詞_ヤ, 未然形_, 命令形_, 連体形_, 連用形_, 連用形_促音便, isAdnominalGenitiveMarkerToken } from "../../../../types/pos.js";
|
|
24
|
+
import { buildBoundaryConnectiveOp, createConnectiveOp, createNegationOp, markQuotedQuestionContextOp } from "./op-builders.js";
|
|
25
|
+
import { NEGATION_OK, classifyTailAux, isNegationToken, mergeNegationOps, matchFocusedNegation, validateNegationChainStart, applyNegationInabilityPolicy, applyShortTailPolicy, buildOpFromClassification, buildConjectureOp, collectNegationChain } from "./parser.js";
|
|
26
|
+
import { connectiveFlavorFields } from "./connective-ops.js";
|
|
27
|
+
import { matchDegreeIntensifierIdiom, matchPermissionIdiom, matchTeEvaluationIdiom, matchBaSufficiencyConditionalIdiom, matchNegativeNecessitySumuIdiom, matchKotoGaDekiru, matchExperienceKotoGaAru, matchDecisionKotoNiSuru, matchOutcomeKotoNiNaru, matchDecisionToSuru, matchNegativeNecessityKotoWa, matchOnlyOption, matchWakeImpossibleIdiom, matchInevitableZaruOEnaiIdiom, matchCannotRefrainNegativeDewaIrarenai, matchMethodYouGaNaiIdiom, matchMadeMoNaiIdiom } from "./matchers/lexical-idioms.js";
|
|
28
|
+
import { matchLimitNegationModal, matchModalAtCursor } from "./matchers/modal-tail.js";
|
|
29
|
+
import { TERMINAL_SFP_RUN_BRIDGE_LIMIT, matchTerminalSfpArbitration, matchPlainNominalizerTerminal, matchPredicateConfirmationJanaiSfp, matchVolitionalConfirmationQuotativeConnective, isVolitionalTerminalContext, matchDialectalRedundantTerminalParticle } from "./matchers/terminal-sfp.js";
|
|
30
|
+
import { matchPredicateQuoteCarrier, matchTerminalPastQuoteAllomorphCarrier, predicateQuoteCarrierStartsAt, matchToConditionalConnective, matchElidedHostCommandQuotativeConnective, quotedMoodPayload, absorbBareTeDirectiveIntoCarrier, matchElidedHostPoliteVolitionalQuotativeConnective, matchElidedHostPoliteCopulaQuotativeConnective, matchElidedHostConditionalQuotativeConnective, matchElidedHostQuoteFocusEvenConnective, matchElidedHostQuoteTopicExclamativeSfp, matchBareTteQuotativeConnective, isContractedNegativeConditionalToken, matchQuotativeConnective, matchBareTeRequestQuoteConnective, matchQuoteFocusQuotativeConnective, matchQuestionQuotativeConnective, matchSfpBridgedQuoteCarrier } from "./matchers/predicate-quote.js";
|
|
31
|
+
import { quotedPropositionMood } from "./quote-tail-context.js";
|
|
32
|
+
import { boundNominalReasonQuoteCarrierHostAt, matchBoundNominalReasonConnective, matchBoundNominalListingConnective, matchTameQuotedJudgmentPassiveConnective, matchTokoroResultConnective, matchTameConnective, matchNodeReasonConnective, matchNoNiAdversativeConnective, matchExternalNominalizerConnective, matchNominalizedEvenIfConnective, matchAdjectivalConcessiveTomoConnective, matchTeMoConnective, matchRenyouFocusSupportEllipsisConnective, matchBareMoConcessiveConnective, matchCopulaMoFocusConnective, matchVolitionalPurposeToConnective, matchDatteFocusParticleConnective, matchSfpClosedExemplificationConnective, matchBareVolitionalClosedExemplificationConnective, bareVolitionalExemplificationBoundaryMood, matchExemplificationConnective, matchTeKaraSequenceConnective, matchTeIraiTemporalSinceConnective, matchZuniConnective, matchTariEnumerativeConnective, matchNaraBaConnective, matchClassicalConditionalBaConnective, matchInventoryCompositeConnective, matchReformulationConnective, matchQuotedConcessiveConnective, matchRetrospectiveQuoteConnective, matchQuestionReformulationConnective, matchHokaAdditiveConnective, matchMonoNoConcessiveConnective, matchKuseNiConcessiveConnective, matchNaBridgedKuseNiConcessiveConnective, matchRenyouNominalCopulaReasonConnective, matchPostpositionalInventoryConnective, canOwnNimoKakawarazuConnective } from "./matchers/connective-tail.js";
|
|
33
|
+
import { matchArimasenPoliteNegativeSupport, matchCopulaAtCursor, matchAffirmativeFocusSupport, matchAdjCopulaNegationBridge } from "./matchers/copula-tail.js";
|
|
34
|
+
import { matchPredicateProjectionConnective, matchPredicateProjectionConnectiveBeforeTerminalSfp, matchFocusConnective, matchYouNiPredicateProjectionConnective, matchSfpBridgedQuotativeMannerSimileConnective, closedSfpClosesInterrogative, matchAttributiveBridgedYouNiProjectionConnective, matchPredicateProjectionCarrier, closedSfpRunQuotativeMannerSimileAtBoundary, quotativeMannerSimileMatchInParseSlice } from "./matchers/projection-tail.js";
|
|
35
|
+
import { matchNoBridgedLikenessModal, matchNominalHostLikenessAtCursor } from "./matchers/likeness-modal.js";
|
|
36
|
+
import { matchAttributiveBridgedYouNiPerceptionPostverbAuxiliary, matchPostverbAuxiliary, matchPredicateSuffix, previousOpIsReanchoringDerivationalSuffix, isFusedJaCopulaTerminalBeforeSfp, previousOpIsAffirmativeCopulaNi, previousOpIsSoudaYotaiAdverbialNi, stemCanProjectStateChange, matchFormalToStateResultPostverbAuxiliary, matchAdverbialNiPostverbAuxiliary, matchYouNiNaruPostverbAuxiliary, matchSouNiNaruPostverbAuxiliary, matchSouNiSuruAppearanceBehaviorPostverbAuxiliary, absorbMannerActionControlPastTense, matchYouNiSuruControlPostverbAuxiliary, matchYouNiPerceptionPostverbAuxiliary, matchKaNoYouNiPerceptionPostverbAuxiliary, matchEpistemicHedgePostverbAuxiliary } from "./matchers/postverb-operator.js";
|
|
37
|
+
import { utteranceClosureAfterParsePosition, carrierTerminalContextFor } from "./parse-closure.js";
|
|
38
|
+
import { sourceIndexForInputPosition, hostEnclosingQuoteCloseInParseSlice, contextCursorForInputPosition } from "./parse-coordinates.js";
|
|
39
|
+
import { precedingPrefixFormForStem, isAdjLikeStemNode, isNounLikeStemNode, materializeStemMood, assertStemAnchorBounds, opLastSourceToken, buildStemNode } from "./parse-stem.js";
|
|
40
|
+
import { matchBekiAtCursor, matchForbidden, matchNaitoAfterNegativeNounCopula, elidedColloquialObligationContextFor, matchStemHostedSuppletiveObligation } from "./matchers/obligation-tail.js";
|
|
41
|
+
import { matchSimpleAspect, matchTsutsuAruAspect, matchTeYaruDeterminedCompletion, matchBenefactive, matchDesiderative, matchMiseru, matchCollapsedAspect, matchSplitCollapsedTeIruNegation, markEllipticTeIruSourceHost, collapsedTeIruTokenMarksEllipticNegative, matchCollapsedHonorific, matchRequest, matchProhibition } from "./matchers/te-aspect.js";
|
|
42
|
+
import { hostChainAttachesAsVerbalRenyou, hostChainAttachesAsAdjectivalRenyou, hostChainAttachesAsNegativeRenyou, hostChainAttachesAsNominalCopulaStem } from "./postverb-host-attachment.js";
|
|
43
|
+
function matchOutgoingBoundaryHint(input, cursor, previousOps, stemNode, stemTok) {
|
|
44
|
+
return cursor.tx(c => {
|
|
45
|
+
const pos = c.pos;
|
|
46
|
+
const hint = input.outgoingBoundaryHint;
|
|
47
|
+
if (hint === undefined)
|
|
48
|
+
return null;
|
|
49
|
+
const startIndex = sourceIndexForInputPosition(input, pos);
|
|
50
|
+
if (startIndex !== hint.tokenSpan.start)
|
|
51
|
+
return null;
|
|
52
|
+
while (c.pos < c.end) {
|
|
53
|
+
const current = sourceIndexForInputPosition(input, c.pos);
|
|
54
|
+
if (current > hint.tokenSpan.end)
|
|
55
|
+
break;
|
|
56
|
+
c.advance();
|
|
57
|
+
if (current === hint.tokenSpan.end)
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
const consumed = c.pos - pos;
|
|
61
|
+
if (consumed <= 0)
|
|
62
|
+
return null;
|
|
63
|
+
const endIndex = sourceIndexForInputPosition(input, c.pos - 1);
|
|
64
|
+
if (endIndex !== hint.tokenSpan.end)
|
|
65
|
+
return null;
|
|
66
|
+
const previousForm5A = ((input.tokens[pos - 1])?.pos ?? 0) & POS5A;
|
|
67
|
+
const surface = hint.surface === "も" && previousForm5A === 連用形_
|
|
68
|
+
? "__renyou_mo"
|
|
69
|
+
: hint.surface;
|
|
70
|
+
if (surface === "にもかかわらず" && !canOwnNimoKakawarazuConnective(previousOps, stemNode)) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
if (hint.retrospectiveDiscoveryStyle === "deoni" && !tailOpsEndInPastTense(previousOps)) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
const directQuotative = quotativeMannerSimileMatchInParseSlice(input, c, pos);
|
|
77
|
+
const quotativeReDerive = directQuotative?.closure === "noda_formal_noun"
|
|
78
|
+
? directQuotative
|
|
79
|
+
: quotativeMannerSimileMatchInParseSlice(input, c, pos + 1);
|
|
80
|
+
const closedRunQuotative = closedSfpRunQuotativeMannerSimileAtBoundary(input, c, pos, hint, stemTok, previousOps);
|
|
81
|
+
if (closedRunQuotative === null) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
const quotativeMood = closedRunQuotative !== undefined && closedSfpClosesInterrogative(closedRunQuotative)
|
|
85
|
+
? "interrogative"
|
|
86
|
+
: hint.quotativeMood ?? (quotativeReDerive?.connective === hint.connectiveKind
|
|
87
|
+
? quotativeReDerive.mood
|
|
88
|
+
: undefined);
|
|
89
|
+
const conditionalQuoteEllipsis = conditionalQuoteEllipsisClassForSurface(surface);
|
|
90
|
+
const boundNominalQuoteCarrierHost = hint.connectiveKind === "bound_nominal_reason" &&
|
|
91
|
+
boundNominalReasonQuoteCarrierHostAt(input, previousOps, input.start);
|
|
92
|
+
const boundaryOp = buildBoundaryConnectiveOp(srcSlice(input.tokens, pos, consumed), hint.connectiveKind, surface, hint.surfaceAllomorph);
|
|
93
|
+
const hydratedBoundaryOp = {
|
|
94
|
+
...boundaryOp,
|
|
95
|
+
...connectiveFlavorFields(input.tokens[pos], previousOps),
|
|
96
|
+
...bareVolitionalExemplificationBoundaryMood(input, c, pos, hint.connectiveKind, previousOps),
|
|
97
|
+
...(conditionalQuoteEllipsis === undefined
|
|
98
|
+
? {}
|
|
99
|
+
: { conditionalQuoteEllipsis }),
|
|
100
|
+
...(quotativeMood === undefined ? {} : { quotativeMood }),
|
|
101
|
+
...(closedRunQuotative === undefined ? {} : { closedSfp: closedRunQuotative }),
|
|
102
|
+
...(boundNominalQuoteCarrierHost ? { boundNominalReasonQuoteCarrierHost: true } : {}),
|
|
103
|
+
...(hint.boundNominalReasonMonoNoun === undefined
|
|
104
|
+
? {}
|
|
105
|
+
: { boundNominalReasonMonoNoun: hint.boundNominalReasonMonoNoun }),
|
|
106
|
+
...(hint.retrospectiveDiscoveryStyle === undefined
|
|
107
|
+
? {}
|
|
108
|
+
: { retrospectiveDiscoveryStyle: hint.retrospectiveDiscoveryStyle }),
|
|
109
|
+
...(hint.attemptFocusParticle === undefined
|
|
110
|
+
? {}
|
|
111
|
+
: { attemptFocusParticle: hint.attemptFocusParticle }),
|
|
112
|
+
...(hint.connectiveKind !== "predicate_projection_quote_attributive"
|
|
113
|
+
? {}
|
|
114
|
+
: input.quoteAttributiveHeadFrame === undefined
|
|
115
|
+
? {}
|
|
116
|
+
: { quoteAttributiveFlavor: input.quoteAttributiveHeadFrame.flavor }),
|
|
117
|
+
...(hint.retrospectiveQuotativeFlavor === undefined
|
|
118
|
+
? {}
|
|
119
|
+
: {
|
|
120
|
+
retrospectiveQuotativeFlavor: retrospectiveQuotativeFlavorForStemMood(hint.retrospectiveQuotativeFlavor, stemNode.stemMood)
|
|
121
|
+
}),
|
|
122
|
+
...(hint.quoteBoundary === undefined ? {} : { quoteBoundary: hint.quoteBoundary })
|
|
123
|
+
};
|
|
124
|
+
return hint.quotedQuestionContext === true
|
|
125
|
+
? markQuotedQuestionContextOp(hydratedBoundaryOp)
|
|
126
|
+
: hydratedBoundaryOp;
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function isStemFragmentForm(pos5A) {
|
|
130
|
+
return pos5A === 連用形_ || pos5A === 仮定形_ || pos5A === 未然形_;
|
|
131
|
+
}
|
|
132
|
+
function isOpsFragmentForm(pos5A) {
|
|
133
|
+
return pos5A === 連用形_ || pos5A === 仮定形_;
|
|
134
|
+
}
|
|
135
|
+
export function parseTail(input) {
|
|
136
|
+
const { tokens, start, stem } = input;
|
|
137
|
+
const stemTok = tokens[start];
|
|
138
|
+
if (stemTok === undefined) {
|
|
139
|
+
return { ok: false, reason: "stem token out of range", position: start };
|
|
140
|
+
}
|
|
141
|
+
const semanticStemTok = input.semanticStemToken ?? stemTok;
|
|
142
|
+
const hostQuoteClose = hostEnclosingQuoteCloseInParseSlice(input, start);
|
|
143
|
+
const stemHostedObligation = matchStemHostedSuppletiveObligation(input, stemTok);
|
|
144
|
+
const stemNode = applyNominalHostQuoteDecoration(buildStemNode(stemHostedObligation?.stem ?? stem, stemTok, start, input.headHypothesis), hostQuoteClose?.surface ?? "");
|
|
145
|
+
const ops = [];
|
|
146
|
+
const precedingPrefixForm = precedingPrefixFormForStem(input);
|
|
147
|
+
const state = {
|
|
148
|
+
sfp: null,
|
|
149
|
+
explicitTerminal: null,
|
|
150
|
+
explicitTerminalPayload: undefined,
|
|
151
|
+
adnominalCopulaTerminalMarkerPos: null
|
|
152
|
+
};
|
|
153
|
+
const elidedColloquialObligationContext = elidedColloquialObligationContextFor(input);
|
|
154
|
+
const allowElidedNaitoObligation = elidedColloquialObligationContext === "terminal";
|
|
155
|
+
const cursor = new TokenCursor(tokens, stemHostedObligation?.cursorStart ?? start + 1);
|
|
156
|
+
if (stemHostedObligation !== null) {
|
|
157
|
+
ops.push(stemHostedObligation.op);
|
|
158
|
+
}
|
|
159
|
+
const pc = {
|
|
160
|
+
input,
|
|
161
|
+
tokens,
|
|
162
|
+
start,
|
|
163
|
+
stemTok,
|
|
164
|
+
semanticStemTok,
|
|
165
|
+
stemNode,
|
|
166
|
+
ops,
|
|
167
|
+
precedingPrefixForm,
|
|
168
|
+
elidedColloquialObligationContext,
|
|
169
|
+
allowElidedNaitoObligation,
|
|
170
|
+
cursor
|
|
171
|
+
};
|
|
172
|
+
while (cursor.pos < cursor.end) {
|
|
173
|
+
const token = tokens[cursor.pos];
|
|
174
|
+
if (token === undefined) {
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
const signal = runTailLoopSections(pc, state, token);
|
|
178
|
+
if (signal === "continue") {
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
if (signal === "break") {
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
if (signal !== "next") {
|
|
185
|
+
return signal.return;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
const terminalState = {
|
|
189
|
+
consumedEnd: cursor.pos,
|
|
190
|
+
terminal: state.explicitTerminal,
|
|
191
|
+
terminalPayload: state.explicitTerminalPayload
|
|
192
|
+
};
|
|
193
|
+
seedTailTerminal(pc, state, terminalState);
|
|
194
|
+
const fragmentFailure = applyFragmentTerminalInvariant(pc, state, terminalState);
|
|
195
|
+
if (fragmentFailure !== null) {
|
|
196
|
+
return fragmentFailure;
|
|
197
|
+
}
|
|
198
|
+
resolveImperativeAndElidedNominalizerTerminal(pc, terminalState);
|
|
199
|
+
return finalizeTailParse(pc, state, terminalState);
|
|
200
|
+
}
|
|
201
|
+
function seedTailTerminal(pc, state, terminalState) {
|
|
202
|
+
const { input, ops, cursor } = pc;
|
|
203
|
+
if (terminalState.terminal === null && ops.length === 0 && input.allowAdverbialModifierTerminal === "none") {
|
|
204
|
+
terminalState.terminal = "adverbial_modifier";
|
|
205
|
+
}
|
|
206
|
+
const lastCarrierOp = ops.at(-1);
|
|
207
|
+
if (terminalState.terminal === null &&
|
|
208
|
+
lastCarrierOp?.kind === "predicateProjectionCarrier" &&
|
|
209
|
+
declaredProjectionCarrierBranchTerminal(lastCarrierOp.sourceAllomorph) === "adverbial_modifier") {
|
|
210
|
+
terminalState.terminal = "adverbial_modifier";
|
|
211
|
+
}
|
|
212
|
+
if (terminalState.terminal === "attributive" &&
|
|
213
|
+
state.adnominalCopulaTerminalMarkerPos !== null &&
|
|
214
|
+
cursor.pos > state.adnominalCopulaTerminalMarkerPos + 1) {
|
|
215
|
+
terminalState.terminal = null;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function applyFragmentTerminalInvariant(pc, state, terminalState) {
|
|
219
|
+
const { input, stemNode, ops, cursor } = pc;
|
|
220
|
+
if (ops.length > 0) {
|
|
221
|
+
const opsFragmentFailure = applyOpsFragmentTerminal(pc, state, terminalState);
|
|
222
|
+
if (opsFragmentFailure !== null) {
|
|
223
|
+
return opsFragmentFailure;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
else if (input.stemTerminalOwnedByCaller === true) {
|
|
227
|
+
const hostTok = stemNode.source.tokens[0];
|
|
228
|
+
if (terminalState.terminal === null &&
|
|
229
|
+
hostTok !== undefined &&
|
|
230
|
+
state.sfp === null &&
|
|
231
|
+
canOpenStemRenyouChuushiTerminal(input, stemNode, hostTok)) {
|
|
232
|
+
terminalState.terminal = "renyou_chuushi";
|
|
233
|
+
terminalState.terminalPayload = renyouChuushiPayloadForSource(stemNode.source, input.renyouChuushiTerminalRole);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
else if (terminalState.terminal !== "adverbial_modifier") {
|
|
237
|
+
const stemTok = stemNode.source.tokens[0];
|
|
238
|
+
if (stemTok !== undefined && isStemFragmentForm(stemTok.pos & POS5A) && state.sfp?.effect !== "na_soft_imperative") {
|
|
239
|
+
if (canOpenStemRenyouCompoundPrenominalTerminal(input, stemNode, stemTok)) {
|
|
240
|
+
terminalState.terminal = "attributive";
|
|
241
|
+
}
|
|
242
|
+
else if (canOpenStemRenyouChuushiTerminal(input, stemNode, stemTok)) {
|
|
243
|
+
terminalState.terminal = "renyou_chuushi";
|
|
244
|
+
terminalState.terminalPayload = renyouChuushiPayloadForSource(stemNode.source, input.renyouChuushiTerminalRole);
|
|
245
|
+
}
|
|
246
|
+
else if (canOpenStemMalformedConditionalFragmentTerminal(input, stemNode, stemTok)) {
|
|
247
|
+
ops.push(missingConditionalMarkerConnective(stemNode.source));
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
return {
|
|
251
|
+
ok: false,
|
|
252
|
+
reason: `stem ends with fragment form (surface=${stemTok.surface}, pos5A=${posToString(stemTok.pos)}) — chain/connect signal without terminal`,
|
|
253
|
+
position: cursor.pos
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return null;
|
|
259
|
+
}
|
|
260
|
+
function applyOpsFragmentTerminal(pc, state, terminalState) {
|
|
261
|
+
const { input, stemNode, ops, cursor } = pc;
|
|
262
|
+
const lastOp = ops[ops.length - 1];
|
|
263
|
+
if (lastOp.kind !== "connective" &&
|
|
264
|
+
!(lastOp.kind === "copula" && lastOp.variant === "conditional_nara") &&
|
|
265
|
+
!(lastOp.kind === "modal" && lastOp.modal === "youda" && lastOp.terminal === "adverbial_ni") &&
|
|
266
|
+
!isElidedColloquialObligationTerminal(lastOp)) {
|
|
267
|
+
const lastTok = opLastSourceToken(lastOp);
|
|
268
|
+
if (lastTok !== undefined &&
|
|
269
|
+
isOpsFragmentForm(lastTok.pos & POS5A) &&
|
|
270
|
+
state.sfp?.effect !== "na_soft_imperative" &&
|
|
271
|
+
!isFusedJaCopulaTerminalBeforeSfp(lastOp, lastTok, state.sfp)) {
|
|
272
|
+
if (input.allowAdverbialModifierTerminal === "copula_ni" &&
|
|
273
|
+
(previousOpIsAffirmativeCopulaNi(ops) || previousOpIsSoudaYotaiAdverbialNi(ops))) {
|
|
274
|
+
terminalState.terminal = "adverbial_modifier";
|
|
275
|
+
}
|
|
276
|
+
else if (canOpenOpsRenyouCompoundPrenominalTerminal(input, stemNode, ops, lastTok)) {
|
|
277
|
+
terminalState.terminal = "attributive";
|
|
278
|
+
}
|
|
279
|
+
else if (canOpenRenyouChuushiTerminal(input, stemNode, ops, lastOp, lastTok)) {
|
|
280
|
+
terminalState.terminal = "renyou_chuushi";
|
|
281
|
+
terminalState.terminalPayload = renyouChuushiPayloadForOp(lastOp, input.renyouChuushiTerminalRole);
|
|
282
|
+
}
|
|
283
|
+
else if (canOpenMalformedConditionalFragmentTerminal(input, stemNode, lastOp, lastTok)) {
|
|
284
|
+
ops.push(missingConditionalMarkerConnective(lastOp.source));
|
|
285
|
+
}
|
|
286
|
+
else if (input.stopAtUnparsedTail === true) {
|
|
287
|
+
const trimmedEnd = trimTrailingFragmentOps(ops, isOpsFragmentForm);
|
|
288
|
+
if (trimmedEnd === null) {
|
|
289
|
+
return {
|
|
290
|
+
ok: false,
|
|
291
|
+
reason: `ops end with fragment form (kind=${lastOp.kind}, surface=${lastTok.surface}, pos5A=${posToString(lastTok.pos)}) — chain/connect signal without terminal`,
|
|
292
|
+
position: cursor.pos
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
terminalState.consumedEnd = trimmedEnd;
|
|
296
|
+
}
|
|
297
|
+
else {
|
|
298
|
+
return {
|
|
299
|
+
ok: false,
|
|
300
|
+
reason: `ops end with fragment form (kind=${lastOp.kind}, surface=${lastTok.surface}, pos5A=${posToString(lastTok.pos)}) — chain/connect signal without terminal`,
|
|
301
|
+
position: cursor.pos
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return null;
|
|
307
|
+
}
|
|
308
|
+
function resolveImperativeAndElidedNominalizerTerminal(pc, terminalState) {
|
|
309
|
+
const { input, stemNode, ops, cursor } = pc;
|
|
310
|
+
if (terminalState.terminal === null && ops.length > 0) {
|
|
311
|
+
const lastOp = ops[ops.length - 1];
|
|
312
|
+
if (lastOp.kind !== "aspect" && lastOp.kind !== "connective") {
|
|
313
|
+
const lastTok = opLastSourceToken(lastOp);
|
|
314
|
+
if (lastTok !== undefined && (lastTok.pos & POS5A) === 命令形_) {
|
|
315
|
+
terminalState.terminal = "imperative";
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
if (terminalState.terminal === null && ops.length === 0) {
|
|
320
|
+
const cmdTok = stemNode.source.tokens[stemNode.conjugationAnchor] ?? stemNode.source.tokens[0];
|
|
321
|
+
if (cmdTok !== undefined && (cmdTok.pos & POS5A) === 命令形_) {
|
|
322
|
+
terminalState.terminal = "imperative";
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
if (terminalState.terminal === null &&
|
|
326
|
+
input.allowElidedNominalizerTerminal === true &&
|
|
327
|
+
cursor.pos >= cursor.end) {
|
|
328
|
+
terminalState.terminal = "nominalized";
|
|
329
|
+
terminalState.terminalPayload = {
|
|
330
|
+
kind: "nominalized",
|
|
331
|
+
nominalizerSource: "elided",
|
|
332
|
+
source: { tokens: [], tokenIndices: [] }
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
function finalizeTailParse(pc, state, terminalState) {
|
|
337
|
+
const { input, start, stemNode, ops, cursor } = pc;
|
|
338
|
+
const inabilityOps = applyNegationInabilityPolicy(ops, stemNode, input.lookups);
|
|
339
|
+
const policyOps = stemNode.kind === "verb" || stemNode.kind === "adj"
|
|
340
|
+
? applyShortTailPolicy(inabilityOps, stemNode.kind, stemNode, input.lookups)
|
|
341
|
+
: inabilityOps;
|
|
342
|
+
const normalizedOps = normalizeTosuruModeForTerminal(policyOps, terminalState.terminalPayload);
|
|
343
|
+
const layer = {
|
|
344
|
+
kind: "auxLayer",
|
|
345
|
+
stem: stemNode,
|
|
346
|
+
ops: normalizedOps,
|
|
347
|
+
terminal: terminalState.terminal,
|
|
348
|
+
...(terminalState.terminalPayload === undefined ? {} : { terminalPayload: terminalState.terminalPayload })
|
|
349
|
+
};
|
|
350
|
+
const streamStart = input.streamStart ?? 0;
|
|
351
|
+
let finalizedRoot;
|
|
352
|
+
try {
|
|
353
|
+
finalizedRoot = relocateRoot({ tail: layer, sfp: state.sfp }, streamStart, input.prependSource, input.conjugationAnchor, input.semanticAnchors, input.sourceIndexMap, input.stemSourceOverride);
|
|
354
|
+
}
|
|
355
|
+
catch (err) {
|
|
356
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
357
|
+
return { ok: false, reason: `relocateRoot: ${message}`, position: cursor.pos };
|
|
358
|
+
}
|
|
359
|
+
return {
|
|
360
|
+
ok: true,
|
|
361
|
+
root: finalizedRoot,
|
|
362
|
+
consumed: terminalState.consumedEnd - start
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
const TAIL_LOOP_SECTIONS = [
|
|
366
|
+
parseTailHostBoundary,
|
|
367
|
+
parseTailLimitNegationAndDegreeIdiom,
|
|
368
|
+
parseTailInitialCopula,
|
|
369
|
+
parseTailObligationAndNegativeConditional,
|
|
370
|
+
parseTailKotoAndLexicalIdioms,
|
|
371
|
+
parseTailPostverbAuxiliaries,
|
|
372
|
+
parseTailTeFamilyAspects,
|
|
373
|
+
parseTailQuoteCarriers,
|
|
374
|
+
parseTailScopeBridgesAndBoundNominals,
|
|
375
|
+
parseTailReasonAndConcessiveConnectives,
|
|
376
|
+
parseTailPredicateProjections,
|
|
377
|
+
parseTailLikenessAndPurposeCarriers,
|
|
378
|
+
parseTailNoAndFocusConnectives,
|
|
379
|
+
parseTailEnumerativeAndConditionalConnectives,
|
|
380
|
+
parseTailQuotativeConnectives,
|
|
381
|
+
parseTailNominalizerTerminalAndModals,
|
|
382
|
+
parseTailTerminalSfp,
|
|
383
|
+
parseTailClassifiedAux
|
|
384
|
+
];
|
|
385
|
+
function runTailLoopSections(pc, state, token) {
|
|
386
|
+
for (const section of TAIL_LOOP_SECTIONS) {
|
|
387
|
+
const signal = section(pc, state, token);
|
|
388
|
+
if (signal !== "next") {
|
|
389
|
+
return signal;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
return "next";
|
|
393
|
+
}
|
|
394
|
+
function parseTailHostBoundary(pc, state, token) {
|
|
395
|
+
const { input, tokens, start, stemNode, ops, cursor } = pc;
|
|
396
|
+
if (input.allowExplicitAdnominalNoTerminal === true &&
|
|
397
|
+
ops.length === 0 &&
|
|
398
|
+
cursor.pos === cursor.end - 1 &&
|
|
399
|
+
isAdnominalGenitiveMarkerToken(token)) {
|
|
400
|
+
cursor.advance();
|
|
401
|
+
state.explicitTerminal = "attributive";
|
|
402
|
+
return "break";
|
|
403
|
+
}
|
|
404
|
+
if (ops.length === 0 && isNounLikeStemNode(stemNode)) {
|
|
405
|
+
const contextTokens = input.contextTokens ?? tokens;
|
|
406
|
+
const sourceHostStart = sourceIndexForInputPosition(input, start);
|
|
407
|
+
const sourcePos = sourceIndexForInputPosition(input, cursor.pos);
|
|
408
|
+
if (skipHostEnclosingQuoteClose(contextTokens, sourceHostStart, sourcePos) !== sourcePos) {
|
|
409
|
+
cursor.advance();
|
|
410
|
+
return "continue";
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
if (!predicateQuoteCarrierStartsAt(cursor, input.lookups, input) &&
|
|
414
|
+
tariKeijoujiAdverbialToEvidence(contextCursorForInputPosition(input, cursor.pos), {
|
|
415
|
+
allowProtoFollowingPredicateEvidence: true,
|
|
416
|
+
lookups: input.lookups
|
|
417
|
+
}) !== null) {
|
|
418
|
+
return "break";
|
|
419
|
+
}
|
|
420
|
+
return "next";
|
|
421
|
+
}
|
|
422
|
+
function parseTailLimitNegationAndDegreeIdiom(pc, state, token) {
|
|
423
|
+
const { input, stemNode, ops, cursor } = pc;
|
|
424
|
+
const limitNegationMatch = matchLimitNegationModal(cursor);
|
|
425
|
+
if (limitNegationMatch !== null) {
|
|
426
|
+
ops.push(limitNegationMatch);
|
|
427
|
+
return "continue";
|
|
428
|
+
}
|
|
429
|
+
if (hostChainAttachesAsNominalCopulaStem(stemNode, ops) ||
|
|
430
|
+
hostChainAttachesAsAdjectivalRenyou(stemNode, ops) ||
|
|
431
|
+
hostChainAttachesAsNegativeRenyou(stemNode, ops) ||
|
|
432
|
+
hostChainAttachesAsVerbalRenyou(stemNode, ops)) {
|
|
433
|
+
const degreeIntensifierMatch = matchDegreeIntensifierIdiom(cursor, input.lookups);
|
|
434
|
+
if (degreeIntensifierMatch !== null) {
|
|
435
|
+
ops.push(degreeIntensifierMatch);
|
|
436
|
+
return "continue";
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
return "next";
|
|
440
|
+
}
|
|
441
|
+
function parseTailInitialCopula(pc, state, token) {
|
|
442
|
+
const { input, tokens, stemTok, stemNode, ops, cursor } = pc;
|
|
443
|
+
if (isNounLikeStemNode(stemNode) && ops.length === 0) {
|
|
444
|
+
const nominalLikenessMatch = matchNominalHostLikenessAtCursor(cursor);
|
|
445
|
+
if (nominalLikenessMatch !== null) {
|
|
446
|
+
ops.push(...nominalLikenessMatch);
|
|
447
|
+
return "continue";
|
|
448
|
+
}
|
|
449
|
+
const focusBridgeOp = cursor.tx(c => matchScopeBridgeBeforeBasicCopula(c, { allowFocusIdentityBridge: true }));
|
|
450
|
+
if (focusBridgeOp !== null) {
|
|
451
|
+
pushScopeBridgeOps(ops, focusBridgeOp, cursor.tokens);
|
|
452
|
+
return "continue";
|
|
453
|
+
}
|
|
454
|
+
const copulaStart = cursor.pos;
|
|
455
|
+
const copulaMatch = matchCopulaAtCursor(cursor, input.lookups, {
|
|
456
|
+
allowAdnominalTerminal: input.allowAdnominalCopulaTerminal === true && stemCanProjectStateChange(stemNode)
|
|
457
|
+
}, input);
|
|
458
|
+
if (copulaMatch !== null) {
|
|
459
|
+
if (copulaMatch.adnominal) {
|
|
460
|
+
state.explicitTerminal = "attributive";
|
|
461
|
+
state.adnominalCopulaTerminalMarkerPos = copulaStart;
|
|
462
|
+
}
|
|
463
|
+
ops.push(...(copulaMatch.ops ?? [copulaMatch.op]));
|
|
464
|
+
return "continue";
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
if (previousOpIsReanchoringDerivationalSuffix(ops)) {
|
|
468
|
+
const derivedCopulaStart = cursor.pos;
|
|
469
|
+
const derivedCopulaMatch = matchCopulaAtCursor(cursor, input.lookups, {
|
|
470
|
+
allowAdnominalTerminal: input.allowAdnominalCopulaTerminal === true
|
|
471
|
+
}, input);
|
|
472
|
+
if (derivedCopulaMatch !== null) {
|
|
473
|
+
if (derivedCopulaMatch.adnominal) {
|
|
474
|
+
state.explicitTerminal = "attributive";
|
|
475
|
+
state.adnominalCopulaTerminalMarkerPos = derivedCopulaStart;
|
|
476
|
+
}
|
|
477
|
+
ops.push(...(derivedCopulaMatch.ops ?? [derivedCopulaMatch.op]));
|
|
478
|
+
return "continue";
|
|
479
|
+
}
|
|
480
|
+
const derivedFocusBridgeOp = cursor.tx(matchScopeBridgeBeforeBasicCopula);
|
|
481
|
+
if (derivedFocusBridgeOp !== null) {
|
|
482
|
+
pushScopeBridgeOps(ops, derivedFocusBridgeOp, cursor.tokens);
|
|
483
|
+
return "continue";
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
if (isAdjLikeStemNode(stemNode) && ops.length === 0) {
|
|
487
|
+
const adjFocusBridgeOp = cursor.tx(matchScopeBridgeBeforeBasicCopula);
|
|
488
|
+
if (adjFocusBridgeOp !== null) {
|
|
489
|
+
pushScopeBridgeOps(ops, adjFocusBridgeOp, cursor.tokens);
|
|
490
|
+
return "continue";
|
|
491
|
+
}
|
|
492
|
+
const bridge = matchAdjCopulaNegationBridge(tokens, cursor.pos);
|
|
493
|
+
if (bridge !== null) {
|
|
494
|
+
ops.push(bridge.op);
|
|
495
|
+
cursor.advance(bridge.nextPos - cursor.pos);
|
|
496
|
+
return "continue";
|
|
497
|
+
}
|
|
498
|
+
const copulaStart = cursor.pos;
|
|
499
|
+
const copulaMatch = cursor.tx(c => {
|
|
500
|
+
const match = matchCopulaAtCursor(c, input.lookups, {
|
|
501
|
+
allowAdnominalTerminal: input.allowAdnominalCopulaTerminal === true
|
|
502
|
+
}, input);
|
|
503
|
+
if (match === null) {
|
|
504
|
+
return null;
|
|
505
|
+
}
|
|
506
|
+
const predicateCopula = match.op.variant === "basic" &&
|
|
507
|
+
match.op.polarity === "affirmative" &&
|
|
508
|
+
((stemTok.pos & POS5A) === 連体形_ ||
|
|
509
|
+
isSyntheticDeicticStemToken(stemTok));
|
|
510
|
+
return match.adnominal || predicateCopula ? match : null;
|
|
511
|
+
});
|
|
512
|
+
if (copulaMatch !== null) {
|
|
513
|
+
const adnominalCopula = copulaMatch.adnominal;
|
|
514
|
+
if (adnominalCopula) {
|
|
515
|
+
state.explicitTerminal = "attributive";
|
|
516
|
+
state.adnominalCopulaTerminalMarkerPos = copulaStart;
|
|
517
|
+
}
|
|
518
|
+
ops.push(...(copulaMatch.ops ?? [copulaMatch.op]));
|
|
519
|
+
return "continue";
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
const renyouNominalCopulaConnective = matchRenyouNominalCopulaReasonConnective(cursor, stemTok, stemNode);
|
|
523
|
+
if (renyouNominalCopulaConnective !== null) {
|
|
524
|
+
ops.push(renyouNominalCopulaConnective);
|
|
525
|
+
return "continue";
|
|
526
|
+
}
|
|
527
|
+
return "next";
|
|
528
|
+
}
|
|
529
|
+
function parseTailObligationAndNegativeConditional(pc, state, token) {
|
|
530
|
+
const { input, start, stemTok, stemNode, ops, elidedColloquialObligationContext, allowElidedNaitoObligation, cursor } = pc;
|
|
531
|
+
const obligationOp = cursor.tx(c => tryMatchObligation(c, elidedColloquialObligationContext));
|
|
532
|
+
if (obligationOp !== null) {
|
|
533
|
+
ops.push(obligationOp);
|
|
534
|
+
return "continue";
|
|
535
|
+
}
|
|
536
|
+
if (isContractedNegativeConditionalToken(token)) {
|
|
537
|
+
const chainStartFailure = validateNegationChainStart({
|
|
538
|
+
pos: cursor.pos,
|
|
539
|
+
start,
|
|
540
|
+
stemTok,
|
|
541
|
+
token,
|
|
542
|
+
previousOp: ops.length > 0 ? ops[ops.length - 1] : undefined
|
|
543
|
+
});
|
|
544
|
+
if (chainStartFailure !== null) {
|
|
545
|
+
return { return: chainStartFailure };
|
|
546
|
+
}
|
|
547
|
+
ops.push(createNegationOp({
|
|
548
|
+
source: srcSingle(token, cursor.pos),
|
|
549
|
+
chainDepth: 1,
|
|
550
|
+
chainPast: false,
|
|
551
|
+
stemAux: [],
|
|
552
|
+
preferShortNegation: false
|
|
553
|
+
}), createConnectiveOp({
|
|
554
|
+
connective: "conditional",
|
|
555
|
+
surface: token.surface,
|
|
556
|
+
conditionalFlavor: "plain",
|
|
557
|
+
source: srcSingle(token, cursor.pos)
|
|
558
|
+
}));
|
|
559
|
+
cursor.advance();
|
|
560
|
+
return "continue";
|
|
561
|
+
}
|
|
562
|
+
const nounCopulaNaitoMatch = matchNaitoAfterNegativeNounCopula(cursor, ops, allowElidedNaitoObligation);
|
|
563
|
+
if (nounCopulaNaitoMatch !== null) {
|
|
564
|
+
ops.push(nounCopulaNaitoMatch);
|
|
565
|
+
return "continue";
|
|
566
|
+
}
|
|
567
|
+
const bekiMatch = matchBekiAtCursor(input, cursor);
|
|
568
|
+
if (bekiMatch !== null) {
|
|
569
|
+
ops.push(...(bekiMatch.ops ?? [bekiMatch.op]));
|
|
570
|
+
return "continue";
|
|
571
|
+
}
|
|
572
|
+
const forbiddenMatch = matchForbidden(cursor, stemNode, ops);
|
|
573
|
+
if (forbiddenMatch !== null) {
|
|
574
|
+
ops.push(forbiddenMatch);
|
|
575
|
+
return "continue";
|
|
576
|
+
}
|
|
577
|
+
return "next";
|
|
578
|
+
}
|
|
579
|
+
function parseTailKotoAndLexicalIdioms(pc, state, token) {
|
|
580
|
+
const { input, stemTok, ops, cursor } = pc;
|
|
581
|
+
const dekiruMatch = matchKotoGaDekiru(cursor, input.lookups);
|
|
582
|
+
if (dekiruMatch !== null) {
|
|
583
|
+
ops.push(dekiruMatch);
|
|
584
|
+
return "continue";
|
|
585
|
+
}
|
|
586
|
+
const experienceMatch = matchExperienceKotoGaAru(cursor, ops);
|
|
587
|
+
if (experienceMatch !== null) {
|
|
588
|
+
ops.push(experienceMatch);
|
|
589
|
+
return "continue";
|
|
590
|
+
}
|
|
591
|
+
const decisionKotoNiSuruMatch = matchDecisionKotoNiSuru(cursor);
|
|
592
|
+
if (decisionKotoNiSuruMatch !== null) {
|
|
593
|
+
ops.push(decisionKotoNiSuruMatch);
|
|
594
|
+
return "continue";
|
|
595
|
+
}
|
|
596
|
+
const decisionToSuruMatch = matchDecisionToSuru(cursor, ops, stemTok);
|
|
597
|
+
if (decisionToSuruMatch !== null) {
|
|
598
|
+
ops.push(decisionToSuruMatch);
|
|
599
|
+
return "continue";
|
|
600
|
+
}
|
|
601
|
+
const outcomeKotoNiNaruMatch = matchOutcomeKotoNiNaru(cursor);
|
|
602
|
+
if (outcomeKotoNiNaruMatch !== null) {
|
|
603
|
+
ops.push(outcomeKotoNiNaruMatch);
|
|
604
|
+
return "continue";
|
|
605
|
+
}
|
|
606
|
+
const negativeNecessityKotoWaMatch = matchNegativeNecessityKotoWa(cursor, ops, stemTok);
|
|
607
|
+
if (negativeNecessityKotoWaMatch !== null) {
|
|
608
|
+
ops.push(negativeNecessityKotoWaMatch);
|
|
609
|
+
return "continue";
|
|
610
|
+
}
|
|
611
|
+
const onlyOptionMatch = matchOnlyOption(cursor, stemTok);
|
|
612
|
+
if (onlyOptionMatch !== null) {
|
|
613
|
+
ops.push(onlyOptionMatch);
|
|
614
|
+
return "continue";
|
|
615
|
+
}
|
|
616
|
+
const wakeImpossibleMatch = matchWakeImpossibleIdiom(cursor);
|
|
617
|
+
if (wakeImpossibleMatch !== null) {
|
|
618
|
+
ops.push(wakeImpossibleMatch);
|
|
619
|
+
return "continue";
|
|
620
|
+
}
|
|
621
|
+
const cannotRefrainMatch = matchCannotRefrainNegativeDewaIrarenai(cursor, ops);
|
|
622
|
+
if (cannotRefrainMatch !== null) {
|
|
623
|
+
ops.push(cannotRefrainMatch);
|
|
624
|
+
return "continue";
|
|
625
|
+
}
|
|
626
|
+
const inevitableZaruMatch = matchInevitableZaruOEnaiIdiom(cursor);
|
|
627
|
+
if (inevitableZaruMatch !== null) {
|
|
628
|
+
ops.push(inevitableZaruMatch);
|
|
629
|
+
return "continue";
|
|
630
|
+
}
|
|
631
|
+
const methodYouGaNaiMatch = matchMethodYouGaNaiIdiom(cursor);
|
|
632
|
+
if (methodYouGaNaiMatch !== null) {
|
|
633
|
+
ops.push(methodYouGaNaiMatch);
|
|
634
|
+
return "continue";
|
|
635
|
+
}
|
|
636
|
+
const madeMoNaiMatch = matchMadeMoNaiIdiom(cursor);
|
|
637
|
+
if (madeMoNaiMatch !== null) {
|
|
638
|
+
ops.push(madeMoNaiMatch);
|
|
639
|
+
return "continue";
|
|
640
|
+
}
|
|
641
|
+
const tsutsuAruMatch = matchTsutsuAruAspect(cursor);
|
|
642
|
+
if (tsutsuAruMatch !== null) {
|
|
643
|
+
ops.push(tsutsuAruMatch);
|
|
644
|
+
return "continue";
|
|
645
|
+
}
|
|
646
|
+
return "next";
|
|
647
|
+
}
|
|
648
|
+
function parseTailPostverbAuxiliaries(pc, state, token) {
|
|
649
|
+
const { input, stemTok, stemNode, ops, precedingPrefixForm, cursor } = pc;
|
|
650
|
+
const formalToStateResultMatch = matchFormalToStateResultPostverbAuxiliary(cursor, stemNode, ops, {
|
|
651
|
+
suppressToSuruControl: input.suppressFormalToSuruControl === true
|
|
652
|
+
});
|
|
653
|
+
if (formalToStateResultMatch !== null) {
|
|
654
|
+
ops.push(formalToStateResultMatch);
|
|
655
|
+
return "continue";
|
|
656
|
+
}
|
|
657
|
+
const adverbialNiPostverbMatch = matchAdverbialNiPostverbAuxiliary(cursor, stemTok, stemNode);
|
|
658
|
+
if (adverbialNiPostverbMatch !== null) {
|
|
659
|
+
ops.push(adverbialNiPostverbMatch);
|
|
660
|
+
return "continue";
|
|
661
|
+
}
|
|
662
|
+
const postverbAuxiliaryMatch = matchPostverbAuxiliary(cursor, stemTok, stemNode, ops, input.lookups, precedingPrefixForm, carrierTerminalContextFor(input));
|
|
663
|
+
if (postverbAuxiliaryMatch !== null) {
|
|
664
|
+
ops.push(postverbAuxiliaryMatch);
|
|
665
|
+
return "continue";
|
|
666
|
+
}
|
|
667
|
+
const predicateSuffixMatch = matchPredicateSuffix(cursor, stemNode, stemTok, ops, input.lookups);
|
|
668
|
+
if (predicateSuffixMatch !== null) {
|
|
669
|
+
ops.push(predicateSuffixMatch);
|
|
670
|
+
return "continue";
|
|
671
|
+
}
|
|
672
|
+
return "next";
|
|
673
|
+
}
|
|
674
|
+
function parseTailTeFamilyAspects(pc, state, token) {
|
|
675
|
+
const { input, stemTok, semanticStemTok, stemNode, ops, cursor } = pc;
|
|
676
|
+
const splitCollapsedTeIruNegation = matchSplitCollapsedTeIruNegation(cursor, ops, stemNode);
|
|
677
|
+
if (splitCollapsedTeIruNegation !== null) {
|
|
678
|
+
ops.push(splitCollapsedTeIruNegation);
|
|
679
|
+
return "continue";
|
|
680
|
+
}
|
|
681
|
+
const aspectMatch = ops.at(-1)?.kind === "polite"
|
|
682
|
+
? null
|
|
683
|
+
: matchSimpleAspect(cursor, semanticStemTok, input.lookups);
|
|
684
|
+
if (aspectMatch !== null) {
|
|
685
|
+
ops.push(...aspectMatch);
|
|
686
|
+
return "continue";
|
|
687
|
+
}
|
|
688
|
+
const teYaruDeterminedCompletionMatch = matchTeYaruDeterminedCompletion(cursor, stemTok, input.lookups);
|
|
689
|
+
if (teYaruDeterminedCompletionMatch !== null) {
|
|
690
|
+
ops.push(teYaruDeterminedCompletionMatch);
|
|
691
|
+
return "continue";
|
|
692
|
+
}
|
|
693
|
+
const benefactiveMatch = matchBenefactive(cursor, stemTok, input.lookups, ops);
|
|
694
|
+
if (benefactiveMatch !== null) {
|
|
695
|
+
ops.push(benefactiveMatch);
|
|
696
|
+
return "continue";
|
|
697
|
+
}
|
|
698
|
+
const requestMatch = matchRequest(cursor, input.lookups);
|
|
699
|
+
if (requestMatch !== null) {
|
|
700
|
+
ops.push(requestMatch);
|
|
701
|
+
return "continue";
|
|
702
|
+
}
|
|
703
|
+
const prohibitionMatch = matchProhibition(cursor, input);
|
|
704
|
+
if (prohibitionMatch !== null) {
|
|
705
|
+
ops.push(prohibitionMatch);
|
|
706
|
+
return "continue";
|
|
707
|
+
}
|
|
708
|
+
const bareTeRequestQuoteMatch = matchBareTeRequestQuoteConnective(input, cursor);
|
|
709
|
+
if (bareTeRequestQuoteMatch !== null) {
|
|
710
|
+
ops.push(bareTeRequestQuoteMatch);
|
|
711
|
+
return "continue";
|
|
712
|
+
}
|
|
713
|
+
const collapsedMatch = matchCollapsedAspect(cursor);
|
|
714
|
+
if (collapsedMatch !== null) {
|
|
715
|
+
const collapsedNegation = matchNegationEnding(cursor.tokens, cursor.pos, { allowAttributive: true });
|
|
716
|
+
const afterCollapsedNegation = collapsedNegation === null
|
|
717
|
+
? undefined
|
|
718
|
+
: cursor.tokens[cursor.pos + collapsedNegation.consumed];
|
|
719
|
+
const feedsNaideProhibition = afterCollapsedNegation?.surface === "で" &&
|
|
720
|
+
isTeConnectiveToken(afterCollapsedNegation);
|
|
721
|
+
const ellipticNegative = collapsedTeIruTokenMarksEllipticNegative(collapsedMatch) &&
|
|
722
|
+
ops.reduce(sourceVerbalPredicateAfterAuxOp, stemHasSourceVerbalPredicateEvidence(stemNode)) &&
|
|
723
|
+
cursor.current() !== undefined &&
|
|
724
|
+
(isAdjNai(cursor.current()) || isNegationToken(cursor.current())) &&
|
|
725
|
+
collapsedNegation !== null &&
|
|
726
|
+
!feedsNaideProhibition;
|
|
727
|
+
ops.push(ellipticNegative ? markEllipticTeIruSourceHost(collapsedMatch) : collapsedMatch);
|
|
728
|
+
return "continue";
|
|
729
|
+
}
|
|
730
|
+
const collapsedHonorificMatch = matchCollapsedHonorific(cursor);
|
|
731
|
+
if (collapsedHonorificMatch !== null) {
|
|
732
|
+
ops.push(collapsedHonorificMatch);
|
|
733
|
+
return "continue";
|
|
734
|
+
}
|
|
735
|
+
const desiderativeMatch = matchDesiderative(cursor, input.lookups);
|
|
736
|
+
if (desiderativeMatch !== null) {
|
|
737
|
+
ops.push(desiderativeMatch);
|
|
738
|
+
return "continue";
|
|
739
|
+
}
|
|
740
|
+
const miseruMatch = matchMiseru(cursor, input.lookups);
|
|
741
|
+
if (miseruMatch !== null) {
|
|
742
|
+
ops.push(miseruMatch);
|
|
743
|
+
return "continue";
|
|
744
|
+
}
|
|
745
|
+
return "next";
|
|
746
|
+
}
|
|
747
|
+
function parseTailQuoteCarriers(pc, state, token) {
|
|
748
|
+
const { input, stemTok, stemNode, ops, cursor } = pc;
|
|
749
|
+
const outgoingBoundaryHintMatch = matchOutgoingBoundaryHint(input, cursor, ops, stemNode, stemTok);
|
|
750
|
+
if (outgoingBoundaryHintMatch !== null) {
|
|
751
|
+
ops.push(outgoingBoundaryHintMatch);
|
|
752
|
+
return "continue";
|
|
753
|
+
}
|
|
754
|
+
if (matchDialectalRedundantTerminalParticle(input, cursor, ops)) {
|
|
755
|
+
return "continue";
|
|
756
|
+
}
|
|
757
|
+
const terminalPastQuoteAllomorphMatch = matchTerminalPastQuoteAllomorphCarrier(input, cursor, ops);
|
|
758
|
+
if (terminalPastQuoteAllomorphMatch !== null) {
|
|
759
|
+
ops.push(terminalPastQuoteAllomorphMatch);
|
|
760
|
+
return "continue";
|
|
761
|
+
}
|
|
762
|
+
const reformulationMatch = matchReformulationConnective(cursor, input);
|
|
763
|
+
if (reformulationMatch !== null) {
|
|
764
|
+
ops.push(reformulationMatch);
|
|
765
|
+
return "continue";
|
|
766
|
+
}
|
|
767
|
+
const predicateQuoteCarrierMatch = input.stopAtUnparsedTail === true
|
|
768
|
+
? null
|
|
769
|
+
: matchPredicateQuoteCarrier(cursor, input.lookups, stemTok, ops, input);
|
|
770
|
+
if (predicateQuoteCarrierMatch !== null) {
|
|
771
|
+
ops.push(absorbBareTeDirectiveIntoCarrier(ops, predicateQuoteCarrierMatch, stemTok));
|
|
772
|
+
return "continue";
|
|
773
|
+
}
|
|
774
|
+
const volitionalConfirmationQuotativeMatch = matchVolitionalConfirmationQuotativeConnective(input, cursor, stemTok, ops);
|
|
775
|
+
if (volitionalConfirmationQuotativeMatch !== null) {
|
|
776
|
+
ops.push(volitionalConfirmationQuotativeMatch);
|
|
777
|
+
return "continue";
|
|
778
|
+
}
|
|
779
|
+
const predicateConfirmationJanaiBeforeBridgeMatch = isVolitionalTerminalContext(stemTok, ops)
|
|
780
|
+
? matchPredicateConfirmationJanaiSfp(input, cursor, stemTok, ops)
|
|
781
|
+
: null;
|
|
782
|
+
if (predicateConfirmationJanaiBeforeBridgeMatch !== null) {
|
|
783
|
+
state.sfp = predicateConfirmationJanaiBeforeBridgeMatch;
|
|
784
|
+
return "break";
|
|
785
|
+
}
|
|
786
|
+
return "next";
|
|
787
|
+
}
|
|
788
|
+
function parseTailScopeBridgesAndBoundNominals(pc, state, token) {
|
|
789
|
+
const { input, start, stemNode, ops, cursor } = pc;
|
|
790
|
+
const implicitFocusOp = cursor.tx(c => matchImplicitNegativeFocusBridge(c, stemNode, ops[ops.length - 1]));
|
|
791
|
+
if (implicitFocusOp !== null) {
|
|
792
|
+
pushScopeBridgeOps(ops, implicitFocusOp, cursor.tokens);
|
|
793
|
+
return "continue";
|
|
794
|
+
}
|
|
795
|
+
const elidedNominalizerBridgeOp = cursor.tx(c => matchElidedNominalizerScopeBridge(c, ops[ops.length - 1]));
|
|
796
|
+
if (elidedNominalizerBridgeOp !== null) {
|
|
797
|
+
ops.push(elidedNominalizerBridgeOp);
|
|
798
|
+
return "continue";
|
|
799
|
+
}
|
|
800
|
+
const scopeBridgeOp = cursor.tx(c => matchScopeBridge(c, {
|
|
801
|
+
allowElidedNegativeBody: input.allowElidedDewaNegativeBody !== undefined
|
|
802
|
+
}));
|
|
803
|
+
if (scopeBridgeOp !== null) {
|
|
804
|
+
pushScopeBridgeOps(ops, scopeBridgeOp, cursor.tokens);
|
|
805
|
+
return "continue";
|
|
806
|
+
}
|
|
807
|
+
const boundNominalReasonMatch = matchBoundNominalReasonConnective(input, cursor);
|
|
808
|
+
if (boundNominalReasonMatch !== null) {
|
|
809
|
+
ops.push(boundNominalReasonQuoteCarrierHostAt(input, ops, start)
|
|
810
|
+
? { ...boundNominalReasonMatch, boundNominalReasonQuoteCarrierHost: true }
|
|
811
|
+
: boundNominalReasonMatch);
|
|
812
|
+
return "continue";
|
|
813
|
+
}
|
|
814
|
+
const boundNominalListingMatch = matchBoundNominalListingConnective(cursor);
|
|
815
|
+
if (boundNominalListingMatch !== null) {
|
|
816
|
+
ops.push(boundNominalListingMatch);
|
|
817
|
+
return "continue";
|
|
818
|
+
}
|
|
819
|
+
return "next";
|
|
820
|
+
}
|
|
821
|
+
function parseTailReasonAndConcessiveConnectives(pc, state, token) {
|
|
822
|
+
const { input, stemTok, ops, cursor } = pc;
|
|
823
|
+
const tameQuotedJudgmentPassiveMatch = matchTameQuotedJudgmentPassiveConnective(cursor);
|
|
824
|
+
if (tameQuotedJudgmentPassiveMatch !== null) {
|
|
825
|
+
ops.push(tameQuotedJudgmentPassiveMatch);
|
|
826
|
+
return "continue";
|
|
827
|
+
}
|
|
828
|
+
const tameConnectiveMatch = matchTameConnective(cursor, ops, stemTok, input.lookups);
|
|
829
|
+
if (tameConnectiveMatch !== null) {
|
|
830
|
+
ops.push(tameConnectiveMatch);
|
|
831
|
+
return "continue";
|
|
832
|
+
}
|
|
833
|
+
const tokoroResultConnectiveMatch = matchTokoroResultConnective(input, cursor, ops);
|
|
834
|
+
if (tokoroResultConnectiveMatch !== null) {
|
|
835
|
+
ops.push(tokoroResultConnectiveMatch);
|
|
836
|
+
return "continue";
|
|
837
|
+
}
|
|
838
|
+
const hokaAdditiveMatch = matchHokaAdditiveConnective(cursor);
|
|
839
|
+
if (hokaAdditiveMatch !== null) {
|
|
840
|
+
ops.push(hokaAdditiveMatch);
|
|
841
|
+
return "continue";
|
|
842
|
+
}
|
|
843
|
+
const monoNoConcessiveMatch = matchMonoNoConcessiveConnective(cursor);
|
|
844
|
+
if (monoNoConcessiveMatch !== null) {
|
|
845
|
+
ops.push(monoNoConcessiveMatch);
|
|
846
|
+
return "continue";
|
|
847
|
+
}
|
|
848
|
+
const kuseNiConcessiveMatch = cursor.tx(c => matchKuseNiConcessiveConnective(c, stemTok)) ??
|
|
849
|
+
cursor.tx(matchNaBridgedKuseNiConcessiveConnective);
|
|
850
|
+
if (kuseNiConcessiveMatch !== null) {
|
|
851
|
+
ops.push(kuseNiConcessiveMatch);
|
|
852
|
+
return "continue";
|
|
853
|
+
}
|
|
854
|
+
return "next";
|
|
855
|
+
}
|
|
856
|
+
function parseTailPredicateProjections(pc, state, token) {
|
|
857
|
+
const { input, stemTok, ops, cursor } = pc;
|
|
858
|
+
const predicateProjectionConnectiveOptions = {
|
|
859
|
+
allowNoQuoteReportingProjection: input.allowNoQuoteReportingProjection === true,
|
|
860
|
+
lookups: input.lookups,
|
|
861
|
+
...(input.quoteAttributiveHeadFrame === undefined
|
|
862
|
+
? {}
|
|
863
|
+
: { quoteAttributiveHeadFrame: input.quoteAttributiveHeadFrame }),
|
|
864
|
+
purposeMotionClosureAfterMarker: (markerPos) => utteranceClosureAfterParsePosition(input, markerPos)
|
|
865
|
+
};
|
|
866
|
+
const predicateProjectionConnectiveMatch = matchPredicateProjectionConnective(cursor, predicateProjectionConnectiveOptions);
|
|
867
|
+
if (predicateProjectionConnectiveMatch !== null) {
|
|
868
|
+
ops.push(predicateProjectionConnectiveMatch);
|
|
869
|
+
return "continue";
|
|
870
|
+
}
|
|
871
|
+
const focusConnectiveMatch = matchFocusConnective(cursor);
|
|
872
|
+
if (focusConnectiveMatch !== null) {
|
|
873
|
+
ops.push(focusConnectiveMatch);
|
|
874
|
+
return "continue";
|
|
875
|
+
}
|
|
876
|
+
const predicateProjectionCarrierMatch = matchPredicateProjectionCarrier(cursor, ops, input.lookups, input, stemTok);
|
|
877
|
+
if (predicateProjectionCarrierMatch !== null) {
|
|
878
|
+
ops.push(predicateProjectionCarrierMatch);
|
|
879
|
+
return "continue";
|
|
880
|
+
}
|
|
881
|
+
const predicateProjectionBeforeSfpMatch = matchPredicateProjectionConnectiveBeforeTerminalSfp(cursor, {
|
|
882
|
+
...predicateProjectionConnectiveOptions,
|
|
883
|
+
stemToken: stemTok
|
|
884
|
+
});
|
|
885
|
+
if (predicateProjectionBeforeSfpMatch !== null) {
|
|
886
|
+
ops.push(predicateProjectionBeforeSfpMatch);
|
|
887
|
+
return "continue";
|
|
888
|
+
}
|
|
889
|
+
return "next";
|
|
890
|
+
}
|
|
891
|
+
function parseTailLikenessAndPurposeCarriers(pc, state, token) {
|
|
892
|
+
const { input, stemTok, ops, cursor } = pc;
|
|
893
|
+
const youNiNaruPostverbMatch = matchYouNiNaruPostverbAuxiliary(cursor, carrierTerminalContextFor(input));
|
|
894
|
+
if (youNiNaruPostverbMatch !== null) {
|
|
895
|
+
ops.push(youNiNaruPostverbMatch);
|
|
896
|
+
return "continue";
|
|
897
|
+
}
|
|
898
|
+
const souNiNaruPostverbMatch = matchSouNiNaruPostverbAuxiliary(cursor);
|
|
899
|
+
if (souNiNaruPostverbMatch !== null) {
|
|
900
|
+
ops.push(souNiNaruPostverbMatch);
|
|
901
|
+
return "continue";
|
|
902
|
+
}
|
|
903
|
+
const souNiSuruBehaviorPostverbMatch = matchSouNiSuruAppearanceBehaviorPostverbAuxiliary(cursor);
|
|
904
|
+
if (souNiSuruBehaviorPostverbMatch !== null) {
|
|
905
|
+
ops.push(souNiSuruBehaviorPostverbMatch);
|
|
906
|
+
return "continue";
|
|
907
|
+
}
|
|
908
|
+
const hostIsVolitionalMannerHost = YOU_NI_VOLITIONAL_MANNER_HOSTS.has(stemTok.dictionaryForm || stemTok.surface);
|
|
909
|
+
const youNiSuruControlPostverbMatch = matchYouNiSuruControlPostverbAuxiliary(cursor, hostIsVolitionalMannerHost, carrierTerminalContextFor(input));
|
|
910
|
+
if (youNiSuruControlPostverbMatch !== null) {
|
|
911
|
+
absorbMannerActionControlPastTense(ops, youNiSuruControlPostverbMatch);
|
|
912
|
+
ops.push(youNiSuruControlPostverbMatch);
|
|
913
|
+
return "continue";
|
|
914
|
+
}
|
|
915
|
+
const kaNoYouNiPerceptionPostverbMatch = matchKaNoYouNiPerceptionPostverbAuxiliary(cursor);
|
|
916
|
+
if (kaNoYouNiPerceptionPostverbMatch !== null) {
|
|
917
|
+
ops.push(kaNoYouNiPerceptionPostverbMatch);
|
|
918
|
+
return "continue";
|
|
919
|
+
}
|
|
920
|
+
const kaNoYouNiSimileMatch = matchKaNoYouNiMannerSimileConnectiveAt(cursor.tokens, cursor.pos, input.lookups);
|
|
921
|
+
if (kaNoYouNiSimileMatch !== null) {
|
|
922
|
+
ops.push(createConnectiveOp({
|
|
923
|
+
connective: kaNoYouNiSimileMatch.connective,
|
|
924
|
+
surface: kaNoYouNiSimileMatch.surface,
|
|
925
|
+
source: srcSlice(cursor.tokens, cursor.pos, kaNoYouNiSimileMatch.consumed)
|
|
926
|
+
}));
|
|
927
|
+
cursor.advance(kaNoYouNiSimileMatch.consumed);
|
|
928
|
+
return "continue";
|
|
929
|
+
}
|
|
930
|
+
const youNiPerceptionPostverbMatch = matchYouNiPerceptionPostverbAuxiliary(cursor);
|
|
931
|
+
if (youNiPerceptionPostverbMatch !== null) {
|
|
932
|
+
ops.push(youNiPerceptionPostverbMatch);
|
|
933
|
+
return "continue";
|
|
934
|
+
}
|
|
935
|
+
const epistemicHedgePostverbMatch = matchEpistemicHedgePostverbAuxiliary(cursor);
|
|
936
|
+
if (epistemicHedgePostverbMatch !== null) {
|
|
937
|
+
ops.push(epistemicHedgePostverbMatch);
|
|
938
|
+
return "continue";
|
|
939
|
+
}
|
|
940
|
+
const youNiProjectionConnectiveMatch = matchYouNiPredicateProjectionConnective(cursor, {
|
|
941
|
+
allowZeroNiPurpose: input.allowZeroNiPurposeTerminal === true,
|
|
942
|
+
lookups: input.lookups
|
|
943
|
+
});
|
|
944
|
+
if (youNiProjectionConnectiveMatch !== null) {
|
|
945
|
+
ops.push(youNiProjectionConnectiveMatch);
|
|
946
|
+
return "continue";
|
|
947
|
+
}
|
|
948
|
+
const gotokuMatch = matchGotokuMannerSimileConnectiveAt(cursor.tokens, cursor.pos);
|
|
949
|
+
if (gotokuMatch !== null) {
|
|
950
|
+
ops.push(createConnectiveOp({
|
|
951
|
+
connective: gotokuMatch.connective,
|
|
952
|
+
surface: gotokuMatch.surface,
|
|
953
|
+
source: srcSlice(cursor.tokens, cursor.pos, gotokuMatch.consumed)
|
|
954
|
+
}));
|
|
955
|
+
cursor.advance(gotokuMatch.consumed);
|
|
956
|
+
return "continue";
|
|
957
|
+
}
|
|
958
|
+
const bridgedPerception = matchAttributiveBridgedYouNiPerceptionPostverbAuxiliary(cursor);
|
|
959
|
+
if (bridgedPerception !== null) {
|
|
960
|
+
ops.push(bridgedPerception);
|
|
961
|
+
return "continue";
|
|
962
|
+
}
|
|
963
|
+
const bridgedProjection = matchAttributiveBridgedYouNiProjectionConnective(cursor, input.lookups);
|
|
964
|
+
if (bridgedProjection !== null) {
|
|
965
|
+
ops.push(bridgedProjection);
|
|
966
|
+
return "continue";
|
|
967
|
+
}
|
|
968
|
+
const sfpBridgedQuotative = matchSfpBridgedQuotativeMannerSimileConnective(input, cursor, ops, stemTok);
|
|
969
|
+
if (sfpBridgedQuotative !== null) {
|
|
970
|
+
ops.push(sfpBridgedQuotative);
|
|
971
|
+
return "continue";
|
|
972
|
+
}
|
|
973
|
+
return "next";
|
|
974
|
+
}
|
|
975
|
+
function parseTailNoAndFocusConnectives(pc, state, token) {
|
|
976
|
+
const { input, stemTok, stemNode, ops, cursor } = pc;
|
|
977
|
+
const nodeConnectiveMatch = cursor.tx(c => matchNodeReasonConnective(c, input.lookups))
|
|
978
|
+
?? cursor.tx(c => matchNoNiAdversativeConnective(c, stemTok, input));
|
|
979
|
+
if (nodeConnectiveMatch !== null) {
|
|
980
|
+
ops.push(nodeConnectiveMatch);
|
|
981
|
+
return "continue";
|
|
982
|
+
}
|
|
983
|
+
const externalNominalizerMatch = matchExternalNominalizerConnective(cursor);
|
|
984
|
+
if (externalNominalizerMatch !== null) {
|
|
985
|
+
ops.push(externalNominalizerMatch);
|
|
986
|
+
return "continue";
|
|
987
|
+
}
|
|
988
|
+
const nominalizedEvenIfMatch = matchNominalizedEvenIfConnective(cursor);
|
|
989
|
+
if (nominalizedEvenIfMatch !== null) {
|
|
990
|
+
ops.push(nominalizedEvenIfMatch);
|
|
991
|
+
return "continue";
|
|
992
|
+
}
|
|
993
|
+
const negativeNecessitySumuMatch = matchNegativeNecessitySumuIdiom(cursor, ops, stemNode);
|
|
994
|
+
if (negativeNecessitySumuMatch !== null) {
|
|
995
|
+
ops.push(negativeNecessitySumuMatch);
|
|
996
|
+
return "continue";
|
|
997
|
+
}
|
|
998
|
+
const teEvaluationMatch = matchTeEvaluationIdiom(cursor, input.lookups);
|
|
999
|
+
if (teEvaluationMatch !== null) {
|
|
1000
|
+
ops.push(teEvaluationMatch);
|
|
1001
|
+
return "continue";
|
|
1002
|
+
}
|
|
1003
|
+
const permissionMatch = matchPermissionIdiom(cursor, stemNode, ops, input.lookups);
|
|
1004
|
+
if (permissionMatch !== null) {
|
|
1005
|
+
ops.push(permissionMatch);
|
|
1006
|
+
return "continue";
|
|
1007
|
+
}
|
|
1008
|
+
const baSufficiencyMatch = matchBaSufficiencyConditionalIdiom(cursor);
|
|
1009
|
+
if (baSufficiencyMatch !== null) {
|
|
1010
|
+
ops.push(baSufficiencyMatch);
|
|
1011
|
+
return "continue";
|
|
1012
|
+
}
|
|
1013
|
+
const focusedNegationMatch = cursor.tx(matchFocusedNegation);
|
|
1014
|
+
if (focusedNegationMatch !== null) {
|
|
1015
|
+
ops.push(...focusedNegationMatch);
|
|
1016
|
+
return "continue";
|
|
1017
|
+
}
|
|
1018
|
+
const focusSupportMatch = matchAffirmativeFocusSupport(cursor);
|
|
1019
|
+
if (focusSupportMatch !== null) {
|
|
1020
|
+
ops.push(focusSupportMatch);
|
|
1021
|
+
return "continue";
|
|
1022
|
+
}
|
|
1023
|
+
const teMoMatch = matchTeMoConnective(cursor, stemTok, input);
|
|
1024
|
+
if (teMoMatch !== null) {
|
|
1025
|
+
ops.push(teMoMatch);
|
|
1026
|
+
return "continue";
|
|
1027
|
+
}
|
|
1028
|
+
const tomoConcessiveMatch = matchAdjectivalConcessiveTomoConnective(cursor);
|
|
1029
|
+
if (tomoConcessiveMatch !== null) {
|
|
1030
|
+
ops.push(tomoConcessiveMatch);
|
|
1031
|
+
return "continue";
|
|
1032
|
+
}
|
|
1033
|
+
const copulaMoFocusMatch = matchCopulaMoFocusConnective(cursor, input);
|
|
1034
|
+
if (copulaMoFocusMatch !== null) {
|
|
1035
|
+
ops.push(copulaMoFocusMatch);
|
|
1036
|
+
return "continue";
|
|
1037
|
+
}
|
|
1038
|
+
const renyouFocusEllipsisMatch = matchRenyouFocusSupportEllipsisConnective(cursor, input);
|
|
1039
|
+
if (renyouFocusEllipsisMatch !== null) {
|
|
1040
|
+
ops.push(renyouFocusEllipsisMatch);
|
|
1041
|
+
return "continue";
|
|
1042
|
+
}
|
|
1043
|
+
const bareMoConcessionMatch = matchBareMoConcessiveConnective(cursor, input);
|
|
1044
|
+
if (bareMoConcessionMatch !== null) {
|
|
1045
|
+
ops.push(bareMoConcessionMatch);
|
|
1046
|
+
return "continue";
|
|
1047
|
+
}
|
|
1048
|
+
return "next";
|
|
1049
|
+
}
|
|
1050
|
+
function parseTailEnumerativeAndConditionalConnectives(pc, state, token) {
|
|
1051
|
+
const { input, stemTok, stemNode, ops, cursor } = pc;
|
|
1052
|
+
const terminalTokaCarrier = input.stopAtUnparsedTail === true
|
|
1053
|
+
? null
|
|
1054
|
+
: matchPredicateQuoteCarrier(cursor, input.lookups, stemTok, ops, input, {
|
|
1055
|
+
allowTerminalToka: true
|
|
1056
|
+
});
|
|
1057
|
+
if (terminalTokaCarrier !== null) {
|
|
1058
|
+
ops.push(terminalTokaCarrier);
|
|
1059
|
+
return "continue";
|
|
1060
|
+
}
|
|
1061
|
+
const datteFocusMatch = matchDatteFocusParticleConnective(input, cursor, ops);
|
|
1062
|
+
if (datteFocusMatch !== null) {
|
|
1063
|
+
ops.push(datteFocusMatch);
|
|
1064
|
+
return "continue";
|
|
1065
|
+
}
|
|
1066
|
+
const teKaraMatch = matchTeKaraSequenceConnective(cursor);
|
|
1067
|
+
if (teKaraMatch !== null) {
|
|
1068
|
+
ops.push(teKaraMatch);
|
|
1069
|
+
return "continue";
|
|
1070
|
+
}
|
|
1071
|
+
const teIraiMatch = matchTeIraiTemporalSinceConnective(cursor);
|
|
1072
|
+
if (teIraiMatch !== null) {
|
|
1073
|
+
ops.push(teIraiMatch);
|
|
1074
|
+
return "continue";
|
|
1075
|
+
}
|
|
1076
|
+
const zuniMatch = matchZuniConnective(cursor, ops, stemNode);
|
|
1077
|
+
if (zuniMatch !== null) {
|
|
1078
|
+
ops.push(zuniMatch);
|
|
1079
|
+
return "continue";
|
|
1080
|
+
}
|
|
1081
|
+
const tariMatch = matchTariEnumerativeConnective(cursor);
|
|
1082
|
+
if (tariMatch !== null) {
|
|
1083
|
+
ops.push(tariMatch);
|
|
1084
|
+
return "continue";
|
|
1085
|
+
}
|
|
1086
|
+
const naraBaMatch = matchNaraBaConnective(cursor);
|
|
1087
|
+
if (naraBaMatch !== null) {
|
|
1088
|
+
ops.push(naraBaMatch);
|
|
1089
|
+
return "continue";
|
|
1090
|
+
}
|
|
1091
|
+
const taraBaMatch = matchClassicalConditionalBaConnective(cursor, ops);
|
|
1092
|
+
if (taraBaMatch !== null) {
|
|
1093
|
+
ops.push(taraBaMatch);
|
|
1094
|
+
return "continue";
|
|
1095
|
+
}
|
|
1096
|
+
const inventoryCompositeMatch = matchInventoryCompositeConnective(cursor, stemTok);
|
|
1097
|
+
if (inventoryCompositeMatch !== null) {
|
|
1098
|
+
ops.push(inventoryCompositeMatch);
|
|
1099
|
+
return "continue";
|
|
1100
|
+
}
|
|
1101
|
+
const postpositionalConnectiveMatch = matchPostpositionalInventoryConnective(cursor, ops, stemNode);
|
|
1102
|
+
if (postpositionalConnectiveMatch !== null) {
|
|
1103
|
+
ops.push(postpositionalConnectiveMatch);
|
|
1104
|
+
return "continue";
|
|
1105
|
+
}
|
|
1106
|
+
return "next";
|
|
1107
|
+
}
|
|
1108
|
+
function parseTailQuotativeConnectives(pc, state, token) {
|
|
1109
|
+
const { input, stemTok, stemNode, ops, allowElidedNaitoObligation, cursor } = pc;
|
|
1110
|
+
const bareVolitionalExemplification = matchBareVolitionalClosedExemplificationConnective(input, cursor);
|
|
1111
|
+
if (bareVolitionalExemplification !== null) {
|
|
1112
|
+
ops.push({ ...bareVolitionalExemplification, closedChainMood: quotedPropositionMood(stemTok, ops, null) });
|
|
1113
|
+
return "continue";
|
|
1114
|
+
}
|
|
1115
|
+
const exemplificationMatch = matchExemplificationConnective(cursor, input.lookups);
|
|
1116
|
+
if (exemplificationMatch !== null) {
|
|
1117
|
+
ops.push(exemplificationMatch);
|
|
1118
|
+
return "continue";
|
|
1119
|
+
}
|
|
1120
|
+
const quotedConcessiveMatch = matchQuotedConcessiveConnective(cursor);
|
|
1121
|
+
if (quotedConcessiveMatch !== null) {
|
|
1122
|
+
ops.push(quotedConcessiveMatch);
|
|
1123
|
+
return "continue";
|
|
1124
|
+
}
|
|
1125
|
+
const retrospectiveQuoteMatch = matchRetrospectiveQuoteConnective(cursor, stemNode);
|
|
1126
|
+
if (retrospectiveQuoteMatch !== null) {
|
|
1127
|
+
ops.push(retrospectiveQuoteMatch);
|
|
1128
|
+
return "continue";
|
|
1129
|
+
}
|
|
1130
|
+
const questionReformulationMatch = matchQuestionReformulationConnective(cursor);
|
|
1131
|
+
if (questionReformulationMatch !== null) {
|
|
1132
|
+
ops.push(questionReformulationMatch);
|
|
1133
|
+
return "continue";
|
|
1134
|
+
}
|
|
1135
|
+
const questionQuotativeMatch = matchQuestionQuotativeConnective(cursor);
|
|
1136
|
+
if (questionQuotativeMatch !== null) {
|
|
1137
|
+
ops.push(questionQuotativeMatch);
|
|
1138
|
+
return "continue";
|
|
1139
|
+
}
|
|
1140
|
+
const quoteFocusMatch = matchQuoteFocusQuotativeConnective(cursor, ops);
|
|
1141
|
+
if (quoteFocusMatch !== null) {
|
|
1142
|
+
ops.push(quoteFocusMatch);
|
|
1143
|
+
return "continue";
|
|
1144
|
+
}
|
|
1145
|
+
const quotativeMatch = matchQuotativeConnective(input, cursor);
|
|
1146
|
+
if (quotativeMatch !== null) {
|
|
1147
|
+
ops.push(quotativeMatch);
|
|
1148
|
+
return "continue";
|
|
1149
|
+
}
|
|
1150
|
+
const bareTteMatch = matchBareTteQuotativeConnective(cursor);
|
|
1151
|
+
if (bareTteMatch !== null) {
|
|
1152
|
+
ops.push(bareTteMatch);
|
|
1153
|
+
return "continue";
|
|
1154
|
+
}
|
|
1155
|
+
const lastOpForToCond = ops.length > 0 ? ops[ops.length - 1] : undefined;
|
|
1156
|
+
const isAfterNegation = lastOpForToCond?.kind === "negation";
|
|
1157
|
+
const politeVolitionalQuotativeMatch = matchElidedHostPoliteVolitionalQuotativeConnective(input, cursor, ops);
|
|
1158
|
+
if (politeVolitionalQuotativeMatch !== null) {
|
|
1159
|
+
ops.push(politeVolitionalQuotativeMatch);
|
|
1160
|
+
return "continue";
|
|
1161
|
+
}
|
|
1162
|
+
const volitionalPurposeToMatch = matchVolitionalPurposeToConnective(input, cursor, stemTok, ops);
|
|
1163
|
+
if (volitionalPurposeToMatch !== null) {
|
|
1164
|
+
ops.push(volitionalPurposeToMatch);
|
|
1165
|
+
return "continue";
|
|
1166
|
+
}
|
|
1167
|
+
const commandQuotativeMatch = matchElidedHostCommandQuotativeConnective(cursor, ops);
|
|
1168
|
+
if (commandQuotativeMatch !== null) {
|
|
1169
|
+
ops.push(commandQuotativeMatch);
|
|
1170
|
+
return "continue";
|
|
1171
|
+
}
|
|
1172
|
+
const politeCopulaQuotativeMatch = matchElidedHostPoliteCopulaQuotativeConnective(cursor, ops);
|
|
1173
|
+
if (politeCopulaQuotativeMatch !== null) {
|
|
1174
|
+
ops.push(politeCopulaQuotativeMatch);
|
|
1175
|
+
return "continue";
|
|
1176
|
+
}
|
|
1177
|
+
const conditionalQuotativeMatch = matchElidedHostConditionalQuotativeConnective(input, cursor, ops);
|
|
1178
|
+
if (conditionalQuotativeMatch !== null) {
|
|
1179
|
+
ops.push(conditionalQuotativeMatch);
|
|
1180
|
+
return "continue";
|
|
1181
|
+
}
|
|
1182
|
+
const quoteFocusEvenMatch = matchElidedHostQuoteFocusEvenConnective(input, cursor);
|
|
1183
|
+
if (quoteFocusEvenMatch !== null) {
|
|
1184
|
+
ops.push(quoteFocusEvenMatch);
|
|
1185
|
+
return "continue";
|
|
1186
|
+
}
|
|
1187
|
+
const quoteTopicExclamativeMatch = matchElidedHostQuoteTopicExclamativeSfp(input, cursor, ops);
|
|
1188
|
+
if (quoteTopicExclamativeMatch !== null) {
|
|
1189
|
+
state.sfp = quoteTopicExclamativeMatch;
|
|
1190
|
+
return "break";
|
|
1191
|
+
}
|
|
1192
|
+
if (!isAfterNegation || !allowElidedNaitoObligation) {
|
|
1193
|
+
const terminalBareToCarrier = input.stopAtUnparsedTail === true
|
|
1194
|
+
? null
|
|
1195
|
+
: matchPredicateQuoteCarrier(cursor, input.lookups, stemTok, ops, input, {
|
|
1196
|
+
allowTerminalBareTo: true
|
|
1197
|
+
});
|
|
1198
|
+
if (terminalBareToCarrier !== null) {
|
|
1199
|
+
ops.push(absorbBareTeDirectiveIntoCarrier(ops, terminalBareToCarrier, stemTok));
|
|
1200
|
+
return "continue";
|
|
1201
|
+
}
|
|
1202
|
+
const toCondMatch = matchToConditionalConnective(cursor);
|
|
1203
|
+
if (toCondMatch !== null) {
|
|
1204
|
+
ops.push(toCondMatch);
|
|
1205
|
+
return "continue";
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
return "next";
|
|
1209
|
+
}
|
|
1210
|
+
function parseTailNominalizerTerminalAndModals(pc, state, token) {
|
|
1211
|
+
const { input, stemTok, stemNode, ops, elidedColloquialObligationContext, cursor } = pc;
|
|
1212
|
+
const closesAsQuotativeMannerAttributive = ops.at(-1)?.kind === "connective" &&
|
|
1213
|
+
ops.at(-1).connective === "predicate_projection_quotative_manner_simile_attributive";
|
|
1214
|
+
const nominalizerTerminal = closesAsQuotativeMannerAttributive ? null : matchPlainNominalizerTerminal(input, cursor, input.allowPlainNominalizerTerminal === true, input.lookups);
|
|
1215
|
+
if (nominalizerTerminal !== null) {
|
|
1216
|
+
state.explicitTerminal = "nominalized";
|
|
1217
|
+
state.explicitTerminalPayload = nominalizerTerminal;
|
|
1218
|
+
return "break";
|
|
1219
|
+
}
|
|
1220
|
+
const arimasenSupportMatch = matchArimasenPoliteNegativeSupport(cursor, stemNode, ops);
|
|
1221
|
+
if (arimasenSupportMatch !== null) {
|
|
1222
|
+
const lastOp = ops[ops.length - 1];
|
|
1223
|
+
if (lastOp?.kind === "negation") {
|
|
1224
|
+
ops[ops.length - 1] = mergeNegationOps(lastOp, arimasenSupportMatch.negation);
|
|
1225
|
+
ops.push(arimasenSupportMatch.polite);
|
|
1226
|
+
}
|
|
1227
|
+
else {
|
|
1228
|
+
ops.push(arimasenSupportMatch.polite, arimasenSupportMatch.negation);
|
|
1229
|
+
}
|
|
1230
|
+
return "continue";
|
|
1231
|
+
}
|
|
1232
|
+
const noBridgedModal = matchNoBridgedLikenessModal(cursor, stemTok, {
|
|
1233
|
+
previousOps: ops,
|
|
1234
|
+
lookups: input.lookups,
|
|
1235
|
+
input,
|
|
1236
|
+
elidedColloquialObligationContext
|
|
1237
|
+
});
|
|
1238
|
+
if (noBridgedModal !== null) {
|
|
1239
|
+
ops.push(...(noBridgedModal.ops ?? [noBridgedModal.op]));
|
|
1240
|
+
if (noBridgedModal.terminal !== undefined) {
|
|
1241
|
+
state.explicitTerminal = noBridgedModal.terminal;
|
|
1242
|
+
return "break";
|
|
1243
|
+
}
|
|
1244
|
+
return "continue";
|
|
1245
|
+
}
|
|
1246
|
+
const modalMatch = matchModalAtCursor(cursor, stemTok, {
|
|
1247
|
+
previousOps: ops,
|
|
1248
|
+
lookups: input.lookups,
|
|
1249
|
+
input,
|
|
1250
|
+
elidedColloquialObligationContext
|
|
1251
|
+
});
|
|
1252
|
+
if (modalMatch !== null) {
|
|
1253
|
+
ops.push(...(modalMatch.ops ?? [modalMatch.op]));
|
|
1254
|
+
if (modalMatch.terminal !== undefined) {
|
|
1255
|
+
state.explicitTerminal = modalMatch.terminal;
|
|
1256
|
+
return "break";
|
|
1257
|
+
}
|
|
1258
|
+
return "continue";
|
|
1259
|
+
}
|
|
1260
|
+
return "next";
|
|
1261
|
+
}
|
|
1262
|
+
function parseTailTerminalSfp(pc, state, token) {
|
|
1263
|
+
const { input, stemTok, ops, cursor } = pc;
|
|
1264
|
+
const sfpBridgedQuoteCarrier = cursor.tx((c) => matchSfpBridgedQuoteCarrier(input, c, stemTok, ops));
|
|
1265
|
+
if (sfpBridgedQuoteCarrier !== null) {
|
|
1266
|
+
{
|
|
1267
|
+
const bridgedMood = quotedPropositionMood(stemTok, ops, sfpBridgedQuoteCarrier.quotedSfp);
|
|
1268
|
+
const chainMood = sfpBridgedQuoteCarrier.carrier.quotedMood;
|
|
1269
|
+
ops.push(absorbBareTeDirectiveIntoCarrier(ops, {
|
|
1270
|
+
...sfpBridgedQuoteCarrier.carrier,
|
|
1271
|
+
quotedSfp: sfpBridgedQuoteCarrier.quotedSfp,
|
|
1272
|
+
...quotedMoodPayload(bridgedMood),
|
|
1273
|
+
...(chainMood === undefined ? {} : { quotedChainMood: chainMood })
|
|
1274
|
+
}, stemTok));
|
|
1275
|
+
}
|
|
1276
|
+
state.sfp = matchTerminalSfpArbitration(input, cursor, stemTok, ops);
|
|
1277
|
+
return "break";
|
|
1278
|
+
}
|
|
1279
|
+
const sfpClosedExemplification = cursor.tx((c) => {
|
|
1280
|
+
let closedSfp = null;
|
|
1281
|
+
for (let attempt = 0; attempt < TERMINAL_SFP_RUN_BRIDGE_LIMIT; attempt += 1) {
|
|
1282
|
+
const next = matchTerminalSfpArbitration(input, c, stemTok, ops);
|
|
1283
|
+
if (next === null) {
|
|
1284
|
+
return null;
|
|
1285
|
+
}
|
|
1286
|
+
if (closedSfp === null) {
|
|
1287
|
+
closedSfp = next;
|
|
1288
|
+
}
|
|
1289
|
+
const connective = matchSfpClosedExemplificationConnective(input, c);
|
|
1290
|
+
if (connective !== null) {
|
|
1291
|
+
return { ...connective, closedSfp, closedChainMood: quotedPropositionMood(stemTok, ops, null) };
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
return null;
|
|
1295
|
+
});
|
|
1296
|
+
if (sfpClosedExemplification !== null) {
|
|
1297
|
+
ops.push(sfpClosedExemplification);
|
|
1298
|
+
return "continue";
|
|
1299
|
+
}
|
|
1300
|
+
const terminalSfpMatch = matchTerminalSfpArbitration(input, cursor, stemTok, ops);
|
|
1301
|
+
if (terminalSfpMatch !== null) {
|
|
1302
|
+
state.sfp = terminalSfpMatch;
|
|
1303
|
+
return "break";
|
|
1304
|
+
}
|
|
1305
|
+
return "next";
|
|
1306
|
+
}
|
|
1307
|
+
function parseTailClassifiedAux(pc, state, token) {
|
|
1308
|
+
const { input, tokens, start, stemTok, stemNode, ops, cursor } = pc;
|
|
1309
|
+
const precedingIdx = previousNonSpaceIndex(tokens, cursor.pos);
|
|
1310
|
+
const pairedConcessiveNegativeAux = input.outgoingBoundaryHint?.pairedConcessive?.negativeAuxIdx ===
|
|
1311
|
+
sourceIndexForInputPosition(input, cursor.pos);
|
|
1312
|
+
const result = pairedConcessiveNegativeAux
|
|
1313
|
+
? NEGATION_OK
|
|
1314
|
+
: classifyTailAux(token, tokens[cursor.pos + 1], stemNode, precedingIdx === null ? undefined : tokens[precedingIdx], ops);
|
|
1315
|
+
const connectivePositionSignal = rejectTailConnectiveOutOfPosition(pc, token, result);
|
|
1316
|
+
if (connectivePositionSignal !== "next") {
|
|
1317
|
+
return connectivePositionSignal;
|
|
1318
|
+
}
|
|
1319
|
+
if (result.classifications.length === 0) {
|
|
1320
|
+
return recoverUnclassifiedTailToken(pc, state, token, result);
|
|
1321
|
+
}
|
|
1322
|
+
if (result.classifications.length === 1 &&
|
|
1323
|
+
result.classifications[0] === "negation" &&
|
|
1324
|
+
isNaiOrNuToken(token)) {
|
|
1325
|
+
const chainStartFailure = validateNegationChainStart({
|
|
1326
|
+
pos: cursor.pos,
|
|
1327
|
+
start,
|
|
1328
|
+
stemTok,
|
|
1329
|
+
token,
|
|
1330
|
+
previousOp: ops.length > 0 ? ops[ops.length - 1] : undefined
|
|
1331
|
+
});
|
|
1332
|
+
if (chainStartFailure !== null) {
|
|
1333
|
+
return { return: chainStartFailure };
|
|
1334
|
+
}
|
|
1335
|
+
ops.push(collectNegationChain(cursor, pairedConcessiveNegativeAux));
|
|
1336
|
+
return "continue";
|
|
1337
|
+
}
|
|
1338
|
+
for (const cls of result.classifications) {
|
|
1339
|
+
const built = buildOpFromClassification(cls, token, cursor.pos, ops);
|
|
1340
|
+
const previous = ops.at(-1);
|
|
1341
|
+
if (built.kind === "negation" &&
|
|
1342
|
+
previous?.kind === "negation" &&
|
|
1343
|
+
((previous.source.tokens.at(-1)?.pos ?? 0) & POS5A) === 連用形_) {
|
|
1344
|
+
ops[ops.length - 1] = mergeNegationOps(previous, built);
|
|
1345
|
+
}
|
|
1346
|
+
else {
|
|
1347
|
+
ops.push(built);
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
cursor.advance();
|
|
1351
|
+
return "continue";
|
|
1352
|
+
}
|
|
1353
|
+
function rejectTailConnectiveOutOfPosition(pc, token, result) {
|
|
1354
|
+
const { input, tokens, cursor } = pc;
|
|
1355
|
+
const classifiedConnective = result.classifications.includes("connective")
|
|
1356
|
+
? lookupConnectiveBySurface(token.surface)
|
|
1357
|
+
: undefined;
|
|
1358
|
+
if (classifiedConnective !== undefined &&
|
|
1359
|
+
connectiveSurfaceRequiresFinalPosition(classifiedConnective, token.surface) &&
|
|
1360
|
+
cursor.pos + 1 < cursor.end) {
|
|
1361
|
+
if (input.stopAtUnparsedTail === true) {
|
|
1362
|
+
return "break";
|
|
1363
|
+
}
|
|
1364
|
+
return { return: {
|
|
1365
|
+
ok: false,
|
|
1366
|
+
reason: `position ${cursor.pos} (surface=${token.surface}): connective is admitted only at chain-final position`,
|
|
1367
|
+
position: cursor.pos
|
|
1368
|
+
} };
|
|
1369
|
+
}
|
|
1370
|
+
if (result.classifications.includes("connective") &&
|
|
1371
|
+
teDeContinuationRelationAt(tokens, cursor.pos, {
|
|
1372
|
+
consumers: ["tail_multi_clause"],
|
|
1373
|
+
lookups: input.lookups
|
|
1374
|
+
}) !== null) {
|
|
1375
|
+
if (input.stopAtUnparsedTail === true) {
|
|
1376
|
+
return "break";
|
|
1377
|
+
}
|
|
1378
|
+
return { return: {
|
|
1379
|
+
ok: false,
|
|
1380
|
+
reason: `position ${cursor.pos} (surface=${token.surface}): te/de connective opens postverb operator tail`,
|
|
1381
|
+
position: cursor.pos
|
|
1382
|
+
} };
|
|
1383
|
+
}
|
|
1384
|
+
return "next";
|
|
1385
|
+
}
|
|
1386
|
+
function recoverUnclassifiedTailToken(pc, state, token, result) {
|
|
1387
|
+
const { input, ops, cursor } = pc;
|
|
1388
|
+
const p4 = token.pos & POS4;
|
|
1389
|
+
const dialectYaOnRealizedChain = p4 === 助動詞_ヤ && (ops.some((op) => op.kind === "copula") ||
|
|
1390
|
+
((token.pos & POS5) === 連用形_促音便 &&
|
|
1391
|
+
ops.some((op) => op.kind === "tense")));
|
|
1392
|
+
if (!dialectYaOnRealizedChain &&
|
|
1393
|
+
(p4 === 助動詞_ダ || p4 === 助動詞_デス || p4 === 助動詞_ジャ || p4 === 助動詞_ヤ)) {
|
|
1394
|
+
const copulaStart = cursor.pos;
|
|
1395
|
+
const copulaRecovery = matchCopulaAtCursor(cursor, input.lookups, {
|
|
1396
|
+
allowAdnominalTerminal: input.allowAdnominalCopulaTerminal === true
|
|
1397
|
+
}, input);
|
|
1398
|
+
if (copulaRecovery !== null) {
|
|
1399
|
+
if (copulaRecovery.adnominal) {
|
|
1400
|
+
state.explicitTerminal = "attributive";
|
|
1401
|
+
state.adnominalCopulaTerminalMarkerPos = copulaStart;
|
|
1402
|
+
}
|
|
1403
|
+
ops.push(...(copulaRecovery.ops ?? [copulaRecovery.op]));
|
|
1404
|
+
return "continue";
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
if (input.stopAtUnparsedTail === true) {
|
|
1408
|
+
return "break";
|
|
1409
|
+
}
|
|
1410
|
+
const reason = result.reason ?? `out-of-subset token: pos=${JSON.stringify(token.pos)}`;
|
|
1411
|
+
return { return: {
|
|
1412
|
+
ok: false,
|
|
1413
|
+
reason: `position ${cursor.pos} (surface=${token.surface}): ${reason}`,
|
|
1414
|
+
position: cursor.pos
|
|
1415
|
+
} };
|
|
1416
|
+
}
|
|
1417
|
+
function trimTrailingFragmentOps(ops, isFragmentForm) {
|
|
1418
|
+
let end = null;
|
|
1419
|
+
while (ops.length > 0) {
|
|
1420
|
+
const lastOp = ops[ops.length - 1];
|
|
1421
|
+
const lastTok = opLastSourceToken(lastOp);
|
|
1422
|
+
if (lastTok === undefined || !isFragmentForm(lastTok.pos & POS5A)) {
|
|
1423
|
+
return end;
|
|
1424
|
+
}
|
|
1425
|
+
const start = lastOp.source.tokenIndices[0];
|
|
1426
|
+
if (start === undefined) {
|
|
1427
|
+
return null;
|
|
1428
|
+
}
|
|
1429
|
+
end = start;
|
|
1430
|
+
ops.pop();
|
|
1431
|
+
}
|
|
1432
|
+
return end;
|
|
1433
|
+
}
|
|
1434
|
+
export function parseTailContinuation(input) {
|
|
1435
|
+
const { tokens, hostIdx, cursorStart, reachEndExclusive } = input;
|
|
1436
|
+
const hostToken = tokens[hostIdx];
|
|
1437
|
+
if (hostToken === undefined || cursorStart <= hostIdx || reachEndExclusive < cursorStart) {
|
|
1438
|
+
return null;
|
|
1439
|
+
}
|
|
1440
|
+
const parseSlice = [hostToken, ...tokens.slice(cursorStart, reachEndExclusive)];
|
|
1441
|
+
const semanticHostToken = input.semanticHostIdx === undefined ? undefined : tokens[input.semanticHostIdx];
|
|
1442
|
+
const parsed = parseTail({
|
|
1443
|
+
tokens: parseSlice,
|
|
1444
|
+
start: 0,
|
|
1445
|
+
stem: input.stem,
|
|
1446
|
+
lookups: input.lookups,
|
|
1447
|
+
contextTokens: tokens,
|
|
1448
|
+
stopAtUnparsedTail: true,
|
|
1449
|
+
stemTerminalOwnedByCaller: true,
|
|
1450
|
+
allowRenyouChuushiTerminal: input.clauseContinuesAfterReach === true,
|
|
1451
|
+
...(semanticHostToken === undefined ? {} : { semanticStemToken: semanticHostToken }),
|
|
1452
|
+
...(input.allowZeroNiPurposeTerminal === true ? { allowZeroNiPurposeTerminal: true } : {}),
|
|
1453
|
+
...(input.allowElidedColloquialObligation === undefined
|
|
1454
|
+
? {}
|
|
1455
|
+
: { allowElidedColloquialObligation: input.allowElidedColloquialObligation }),
|
|
1456
|
+
...(input.outgoingBoundaryHint === undefined ? {} : { outgoingBoundaryHint: input.outgoingBoundaryHint }),
|
|
1457
|
+
sourceIndexMap: [hostIdx, ...continuationIndices(cursorStart, reachEndExclusive)]
|
|
1458
|
+
});
|
|
1459
|
+
if (!parsed.ok) {
|
|
1460
|
+
return null;
|
|
1461
|
+
}
|
|
1462
|
+
const layer = firstAuxLayer(parsed.root.tail);
|
|
1463
|
+
if (layer === null) {
|
|
1464
|
+
return null;
|
|
1465
|
+
}
|
|
1466
|
+
return {
|
|
1467
|
+
ops: layer.ops,
|
|
1468
|
+
sfp: parsed.root.sfp,
|
|
1469
|
+
terminal: layer.terminal,
|
|
1470
|
+
...(layer.terminalPayload === undefined ? {} : { terminalPayload: layer.terminalPayload }),
|
|
1471
|
+
endExclusive: cursorStart + (parsed.consumed - 1)
|
|
1472
|
+
};
|
|
1473
|
+
}
|
|
1474
|
+
function continuationIndices(start, endExclusive) {
|
|
1475
|
+
const indices = [];
|
|
1476
|
+
for (let idx = start; idx < endExclusive; idx += 1) {
|
|
1477
|
+
indices.push(idx);
|
|
1478
|
+
}
|
|
1479
|
+
return indices;
|
|
1480
|
+
}
|
|
1481
|
+
function isElidedColloquialObligationTerminal(op) {
|
|
1482
|
+
return op.kind === "idiom" &&
|
|
1483
|
+
op.idiom === "obligation" &&
|
|
1484
|
+
(op.variant === "colloquial_nakya" || op.variant === "colloquial_nakucha") &&
|
|
1485
|
+
op.source.tokens.length <= 2;
|
|
1486
|
+
}
|
|
1487
|
+
function relocateRoot(root, streamStart, prependSource, finalConjugationAnchor, finalSemanticAnchors, sourceIndexMap, stemSourceOverride) {
|
|
1488
|
+
if (prependSource !== undefined &&
|
|
1489
|
+
prependSource.tokens.length !== prependSource.tokenIndices.length) {
|
|
1490
|
+
throw new Error(`relocateRoot: prependSource length mismatch (tokens=${prependSource.tokens.length}, ` +
|
|
1491
|
+
`tokenIndices=${prependSource.tokenIndices.length}) — OpSource pair invariant 위반`);
|
|
1492
|
+
}
|
|
1493
|
+
if (stemSourceOverride !== undefined &&
|
|
1494
|
+
stemSourceOverride.tokens.length !== stemSourceOverride.tokenIndices.length) {
|
|
1495
|
+
throw new Error(`relocateRoot: stemSourceOverride length mismatch (tokens=${stemSourceOverride.tokens.length}, ` +
|
|
1496
|
+
`tokenIndices=${stemSourceOverride.tokenIndices.length}) — OpSource pair invariant 위반`);
|
|
1497
|
+
}
|
|
1498
|
+
const mapIndex = (i) => sourceIndexMap?.[i] ?? (i + streamStart);
|
|
1499
|
+
const shiftSource = (src) => ({
|
|
1500
|
+
tokens: src.tokens,
|
|
1501
|
+
tokenIndices: src.tokenIndices.map(mapIndex)
|
|
1502
|
+
});
|
|
1503
|
+
const finalizeTopStem = (stem) => {
|
|
1504
|
+
const baseSource = stemSourceOverride ?? shiftSource(stem.source);
|
|
1505
|
+
if (prependSource === undefined || prependSource.tokens.length === 0) {
|
|
1506
|
+
const needsAnchorOverride = stemSourceOverride !== undefined ||
|
|
1507
|
+
finalConjugationAnchor !== undefined ||
|
|
1508
|
+
finalSemanticAnchors !== undefined;
|
|
1509
|
+
if (!needsAnchorOverride) {
|
|
1510
|
+
switch (stem.kind) {
|
|
1511
|
+
case "verb": return { ...stem, source: baseSource };
|
|
1512
|
+
case "adj": return { ...stem, source: baseSource };
|
|
1513
|
+
case "noun": return { ...stem, source: baseSource };
|
|
1514
|
+
case "adverb": return { ...stem, source: baseSource };
|
|
1515
|
+
case "candidateSet": return { ...stem, source: baseSource };
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
const conjugationAnchor = finalConjugationAnchor ?? stem.conjugationAnchor;
|
|
1519
|
+
const semanticAnchors = finalSemanticAnchors ?? stem.semanticAnchors;
|
|
1520
|
+
assertStemAnchorBounds(baseSource, conjugationAnchor, semanticAnchors);
|
|
1521
|
+
switch (stem.kind) {
|
|
1522
|
+
case "verb": return { ...stem, source: baseSource, conjugationAnchor, semanticAnchors };
|
|
1523
|
+
case "adj": return { ...stem, source: baseSource, conjugationAnchor, semanticAnchors };
|
|
1524
|
+
case "noun": return { ...stem, source: baseSource, conjugationAnchor, semanticAnchors };
|
|
1525
|
+
case "adverb": return { ...stem, source: baseSource, conjugationAnchor, semanticAnchors };
|
|
1526
|
+
case "candidateSet": return { ...stem, source: baseSource, conjugationAnchor, semanticAnchors };
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
const newSource = {
|
|
1530
|
+
tokens: [...prependSource.tokens, ...baseSource.tokens],
|
|
1531
|
+
tokenIndices: [...prependSource.tokenIndices, ...baseSource.tokenIndices]
|
|
1532
|
+
};
|
|
1533
|
+
const conjugationAnchor = finalConjugationAnchor ?? prependSource.tokens.length;
|
|
1534
|
+
const semanticAnchors = finalSemanticAnchors ??
|
|
1535
|
+
Array.from({ length: prependSource.tokens.length }, (_, i) => i);
|
|
1536
|
+
assertStemAnchorBounds(newSource, conjugationAnchor, semanticAnchors);
|
|
1537
|
+
switch (stem.kind) {
|
|
1538
|
+
case "verb": return { ...stem, source: newSource, conjugationAnchor, semanticAnchors };
|
|
1539
|
+
case "adj": return { ...stem, source: newSource, conjugationAnchor, semanticAnchors };
|
|
1540
|
+
case "noun": return { ...stem, source: newSource, conjugationAnchor, semanticAnchors };
|
|
1541
|
+
case "adverb": return { ...stem, source: newSource, conjugationAnchor, semanticAnchors };
|
|
1542
|
+
case "candidateSet": return { ...stem, source: newSource, conjugationAnchor, semanticAnchors };
|
|
1543
|
+
}
|
|
1544
|
+
};
|
|
1545
|
+
const walkAuxOp = (op) => {
|
|
1546
|
+
if ("inner" in op && op.inner !== undefined) {
|
|
1547
|
+
throw new Error(`relocateRoot: AuxOp.inner not supported (op kind=${op.kind}) — walker 갱신 필요`);
|
|
1548
|
+
}
|
|
1549
|
+
if (op.kind === "connective" && op.closedSfp !== undefined) {
|
|
1550
|
+
return {
|
|
1551
|
+
...op,
|
|
1552
|
+
source: shiftSource(op.source),
|
|
1553
|
+
closedSfp: { ...op.closedSfp, source: shiftSource(op.closedSfp.source) }
|
|
1554
|
+
};
|
|
1555
|
+
}
|
|
1556
|
+
if (op.kind === "predicateQuoteCarrier" && op.quotedSfp !== undefined) {
|
|
1557
|
+
return {
|
|
1558
|
+
...op,
|
|
1559
|
+
source: shiftSource(op.source),
|
|
1560
|
+
quotedSfp: { ...op.quotedSfp, source: shiftSource(op.quotedSfp.source) }
|
|
1561
|
+
};
|
|
1562
|
+
}
|
|
1563
|
+
return { ...op, source: shiftSource(op.source) };
|
|
1564
|
+
};
|
|
1565
|
+
const walkTerminalPayload = (payload) => payload.kind === "renyouChuushi" ? { ...payload, source: shiftSource(payload.source) } : payload;
|
|
1566
|
+
const walkAuxLayer = (layer, isTopLevel) => ({
|
|
1567
|
+
...layer,
|
|
1568
|
+
stem: isTopLevel
|
|
1569
|
+
? materializeStemMood(finalizeTopStem(layer.stem))
|
|
1570
|
+
: { ...layer.stem, source: shiftSource(layer.stem.source) },
|
|
1571
|
+
ops: layer.ops.map(walkAuxOp),
|
|
1572
|
+
...(layer.terminalPayload === undefined ? {} : { terminalPayload: walkTerminalPayload(layer.terminalPayload) })
|
|
1573
|
+
});
|
|
1574
|
+
const walkTail = (tail, isTopLevel) => {
|
|
1575
|
+
if (tail.kind === "auxLayer")
|
|
1576
|
+
return walkAuxLayer(tail, isTopLevel);
|
|
1577
|
+
return {
|
|
1578
|
+
...tail,
|
|
1579
|
+
inner: walkAuxLayer(tail.inner, isTopLevel),
|
|
1580
|
+
source: shiftSource(tail.source),
|
|
1581
|
+
outer: walkTail(tail.outer, false)
|
|
1582
|
+
};
|
|
1583
|
+
};
|
|
1584
|
+
return {
|
|
1585
|
+
...root,
|
|
1586
|
+
tail: walkTail(root.tail, true),
|
|
1587
|
+
sfp: root.sfp !== null ? { ...root.sfp, source: shiftSource(root.sfp.source) } : null
|
|
1588
|
+
};
|
|
1589
|
+
}
|
|
1590
|
+
export function normalizeTosuruModeForTerminal(ops, terminalPayload) {
|
|
1591
|
+
if (terminalPayload?.kind !== "attributiveBoundary") {
|
|
1592
|
+
return ops;
|
|
1593
|
+
}
|
|
1594
|
+
const follower = terminalPayload.source.tokens[0];
|
|
1595
|
+
if (follower === undefined) {
|
|
1596
|
+
return ops;
|
|
1597
|
+
}
|
|
1598
|
+
let changed = false;
|
|
1599
|
+
const normalized = ops.map((op) => {
|
|
1600
|
+
if (op.kind !== "predicateQuoteCarrier" ||
|
|
1601
|
+
op.style !== "suru_attributive" ||
|
|
1602
|
+
op.tosuruMode !== "resultative_make") {
|
|
1603
|
+
return op;
|
|
1604
|
+
}
|
|
1605
|
+
const carrier = op.source.tokens.at(-1);
|
|
1606
|
+
if (carrier === undefined || !tosuruResultativeMakeYieldsToAttributiveQuoteHead(carrier, follower)) {
|
|
1607
|
+
return op;
|
|
1608
|
+
}
|
|
1609
|
+
changed = true;
|
|
1610
|
+
return { ...op, tosuruMode: "quote" };
|
|
1611
|
+
});
|
|
1612
|
+
return changed ? normalized : ops;
|
|
1613
|
+
}
|
|
1614
|
+
function pushScopeBridgeOps(ops, bridge, tokens) {
|
|
1615
|
+
ops.push(bridge);
|
|
1616
|
+
if (bridge.conjecture !== true) {
|
|
1617
|
+
return;
|
|
1618
|
+
}
|
|
1619
|
+
const conjectureIdx = bridge.source.tokenIndices[bridge.source.tokenIndices.length - 1];
|
|
1620
|
+
const conjectureToken = conjectureIdx === undefined ? undefined : tokens[conjectureIdx];
|
|
1621
|
+
if (conjectureToken === undefined || conjectureIdx === undefined) {
|
|
1622
|
+
return;
|
|
1623
|
+
}
|
|
1624
|
+
ops.push(buildConjectureOp(srcSingle(conjectureToken, conjectureIdx), false));
|
|
1625
|
+
}
|