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,998 @@
|
|
|
1
|
+
import { toiuAttributiveTailEnd } from "../../../../semantics/marker-roles.js";
|
|
2
|
+
import { TokenCursor } from "../../../../token-cursor.js";
|
|
3
|
+
import { quoteFocusLimitNegationTailStartingAt } from "../../segments/quote-focus.js";
|
|
4
|
+
import { copulaDeMarkerRelationForToken, copulaNiMarkerRelationForToken, dewaScopeBridgeRelationAt, kaMarkerRelationAt, nominalLinkMarkerRelationAt, nominalizerCopulaSupportRelationAt, predicateNominalizerRelationForToken } from "../../../boundary/marker.js";
|
|
5
|
+
import { activeProtoLayout } from "../../../../clause-layout/proto-state.js";
|
|
6
|
+
import { monoModalClauseEvidence } from "../../../../semantics/mono-modal.js";
|
|
7
|
+
import { clauseContainsInterrogativeBeforeKa, clauseContainsLexicalizedInterrogativeBefore, clauseContainsPredicateChoiceKaBefore } from "../../../../quote/embedded-question.js";
|
|
8
|
+
import { quoteMarkerRelationAt } from "../../../boundary/quote-marker.js";
|
|
9
|
+
import { negationFocusParticleForMarker, MONO_MODAL_READING_VALUES, MONO_MODAL_NO_EVIDENCE, hostCarriesPreModalPast } from "../grammar.js";
|
|
10
|
+
import { srcSingle, srcSlice } from "../source.js";
|
|
11
|
+
import { isAruVerbToken, DEARI_LISTING_CONNECTIVE_SURFACE, isAffirmativeCopulaSupportVerbToken, isCopulaJaNegativeBridgeToken, isNaiOrNuToken, isPredicativeCopulaSupportVerbAt, isWakeNounToken } from "../classifiers/tokens.js";
|
|
12
|
+
import { isObligationSpanStartingAtToken } from "./obligation.js";
|
|
13
|
+
import { matchNegationEnding } from "./negation-ending.js";
|
|
14
|
+
import { isKamoShirenaiLemma, matchKamoShirenaiSequence } from "./kamo-modal.js";
|
|
15
|
+
import { matchScopeBridgeTail } from "./scope-bridge.js";
|
|
16
|
+
import { attributiveCopulaTailFollows, isAssertiveCopulaMarkerToken, terminalNodaCarrierFollowsAdnominalCopula, isBareNodaCarrierTerminalSfpFollower, isHazuNounToken, isQuestionParticleToken } from "./copula.js";
|
|
17
|
+
import { POS0, POS01, POS1, POS4, POS5, POS5A, 意志推量形_, 仮定形_, 格助詞, 記号, 係助詞, isNaAdjCapable, 形容詞0, 語幹_, 終止形_, 終助詞, 助詞, 助動詞, 助動詞_ジャ, 助動詞_タ, 助動詞_ダ, 助動詞_デス, 助動詞_マイ, 助動詞_マス, 助動詞_ヤ, 接続助詞, 動詞, 副詞, 副助詞, 文語助動詞_マジ, 補助記号, 名詞, 連体形_, 連用形_, 連用形_促音便, 助詞_係助詞 } from "../../../../../types/pos.js";
|
|
18
|
+
import { createConnectiveOp, createModalOp } from "../op-builders.js";
|
|
19
|
+
import { classifyAux, isSoudaAuxiliaryStemToken, buildConjectureOp } from "../parser.js";
|
|
20
|
+
import { isTailFinalQuestionSfpStart } from "./terminal-sfp.js";
|
|
21
|
+
import { isOutgoingQuoteMarkerPosition } from "../quote-tail-context.js";
|
|
22
|
+
import { matchYouda, renyouChuushiPauseFollowsSupport } from "./likeness-modal.js";
|
|
23
|
+
import { terminalDiscourseSfpRunClosesUtterance, utteranceClosesAtChunkPosition } from "../parse-closure.js";
|
|
24
|
+
import { sourceIndexForInputPosition, contextAlignedPosition } from "../parse-coordinates.js";
|
|
25
|
+
function modalMatchWithFusedConjecture(match, negEnd, tokens, start) {
|
|
26
|
+
if (negEnd.conjecture !== true) {
|
|
27
|
+
return match;
|
|
28
|
+
}
|
|
29
|
+
const conjectureIdx = start + match.consumed - 1;
|
|
30
|
+
const conjectureToken = tokens[conjectureIdx];
|
|
31
|
+
if (conjectureToken === undefined) {
|
|
32
|
+
return match;
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
...match,
|
|
36
|
+
ops: [match.op, buildConjectureOp(srcSingle(conjectureToken, conjectureIdx), false)]
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function matchHazu(cursor, stemToken, ctx) {
|
|
40
|
+
const { tokens, pos, end: n } = cursor;
|
|
41
|
+
const t0 = tokens[pos];
|
|
42
|
+
if (t0 === undefined || !isHazuNounToken(t0))
|
|
43
|
+
return null;
|
|
44
|
+
const t1 = pos + 1 < n ? tokens[pos + 1] : undefined;
|
|
45
|
+
if (t1 === undefined) {
|
|
46
|
+
return canBareBoundModalCarrierTerminate(pos + 1, n)
|
|
47
|
+
? { op: buildHazuOp(srcSlice(tokens, pos, 1), "affirmative", false), consumed: 1 }
|
|
48
|
+
: null;
|
|
49
|
+
}
|
|
50
|
+
const t1pos4 = t1.pos & POS4;
|
|
51
|
+
const t1pos5A = t1.pos & POS5A;
|
|
52
|
+
const hazuNominalLink = nominalLinkMarkerRelationAt(tokens, pos + 1, { consumers: ["tail_multi_clause"] });
|
|
53
|
+
if (hazuNominalLink !== null) {
|
|
54
|
+
const negEnd = matchNegationEnding(tokens, hazuNominalLink.span.endExclusive, { allowAttributive: true, allowConjecture: true });
|
|
55
|
+
if (negEnd !== null) {
|
|
56
|
+
const consumed = hazuNominalLink.span.endExclusive - pos + negEnd.consumed;
|
|
57
|
+
return modalMatchWithFusedConjecture({
|
|
58
|
+
op: buildHazuOp(srcSlice(tokens, pos, consumed), "negative", negEnd.polite),
|
|
59
|
+
consumed,
|
|
60
|
+
terminal: "attributive"
|
|
61
|
+
}, negEnd, tokens, pos);
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
op: buildHazuOp(srcSlice(tokens, pos, 2), "affirmative", false),
|
|
65
|
+
consumed: 2,
|
|
66
|
+
terminal: "attributive"
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
if (t1.surface === "が" && (t1.pos & POS1) === 格助詞) {
|
|
70
|
+
const negEnd = matchNegationEnding(tokens, pos + 2, { allowAttributive: true, allowConjecture: true });
|
|
71
|
+
if (negEnd !== null) {
|
|
72
|
+
return modalMatchWithFusedConjecture({
|
|
73
|
+
op: buildHazuOp(srcSlice(tokens, pos, 2 + negEnd.consumed), "negative", negEnd.polite),
|
|
74
|
+
consumed: 2 + negEnd.consumed
|
|
75
|
+
}, negEnd, tokens, pos);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (isCopulaJaNegativeBridgeToken(t1)) {
|
|
79
|
+
const negEnd = matchNegationEnding(tokens, pos + 2, { allowAttributive: true, allowConjecture: true });
|
|
80
|
+
if (negEnd !== null) {
|
|
81
|
+
return modalMatchWithFusedConjecture({
|
|
82
|
+
op: buildHazuOp(srcSlice(tokens, pos, 2 + negEnd.consumed), "negative", negEnd.polite),
|
|
83
|
+
consumed: 2 + negEnd.consumed
|
|
84
|
+
}, negEnd, tokens, pos);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const hazuDewa = dewaScopeBridgeRelationAt(tokens, pos + 1, {
|
|
88
|
+
anchorIdx: pos,
|
|
89
|
+
consumers: ["tail_multi_clause"]
|
|
90
|
+
});
|
|
91
|
+
if (hazuDewa?.focusParticle === "wa") {
|
|
92
|
+
const negEnd = matchNegationEnding(tokens, hazuDewa.span.endExclusive, { allowAttributive: true, allowConjecture: true });
|
|
93
|
+
if (negEnd !== null) {
|
|
94
|
+
const consumed = hazuDewa.span.endExclusive - pos + negEnd.consumed;
|
|
95
|
+
return modalMatchWithFusedConjecture({
|
|
96
|
+
op: buildHazuOp(srcSlice(tokens, pos, consumed), "negative", negEnd.polite),
|
|
97
|
+
consumed
|
|
98
|
+
}, negEnd, tokens, pos);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (t1pos5A === 終止形_ || t1pos5A === 連用形_) {
|
|
102
|
+
if (t1pos4 === 助動詞_ダ) {
|
|
103
|
+
return { op: buildHazuOp(srcSlice(tokens, pos, 2), "affirmative", false), consumed: 2 };
|
|
104
|
+
}
|
|
105
|
+
if (t1pos4 === 助動詞_デス) {
|
|
106
|
+
return { op: buildHazuOp(srcSlice(tokens, pos, 2), "affirmative", true), consumed: 2 };
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (canBareCarrierFeedFollowingTail(cursor, 1, stemToken, ctx) ||
|
|
110
|
+
terminalDiscourseSfpRunClosesUtterance(cursor, ctx.input, 1)) {
|
|
111
|
+
return { op: buildHazuOp(srcSlice(tokens, pos, 1), "affirmative", false), consumed: 1 };
|
|
112
|
+
}
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
export function buildHazuOp(source, polarity, polite) {
|
|
116
|
+
return createModalOp({
|
|
117
|
+
modal: "hazu",
|
|
118
|
+
source,
|
|
119
|
+
polarity,
|
|
120
|
+
polite,
|
|
121
|
+
past: false
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
function matchMono(cursor, stemToken, ctx) {
|
|
125
|
+
const { tokens, pos, end: n } = cursor;
|
|
126
|
+
const lookups = ctx.lookups;
|
|
127
|
+
const t0 = tokens[pos];
|
|
128
|
+
if (lookups === undefined ||
|
|
129
|
+
t0 === undefined ||
|
|
130
|
+
(t0.pos & POS0) !== 名詞 ||
|
|
131
|
+
!lookups.MONO_MODAL_CARRIER_FORMS.has(t0.surface)) {
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
const host = monoModalHostFacts(stemToken, ctx.previousOps);
|
|
135
|
+
if (host === null || !isAttributiveHostEnding(tokens[pos - 1])) {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
const copula = monoModalAffirmativeCopulaAt(tokens, pos + 1, n);
|
|
139
|
+
if (copula === null) {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
const evidence = monoModalEvidenceAt(ctx, pos, lookups);
|
|
143
|
+
const form = lookups.MONO_MODAL_DEFAULT_READING_CARRIER_FORMS.has(t0.surface) ? "mon" : "mono";
|
|
144
|
+
if (!monoModalAdmits(form, host, evidence, copula.past)) {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
op: buildMonoOp(srcSlice(tokens, pos, 1 + copula.consumed), form, evidence, copula.polite),
|
|
149
|
+
consumed: 1 + copula.consumed
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function isAttributiveHostEnding(token) {
|
|
153
|
+
if (token === undefined) {
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
const pos0 = token.pos & POS0;
|
|
157
|
+
if (pos0 !== 動詞 && pos0 !== 形容詞0 && pos0 !== 助動詞) {
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
const pos5A = token.pos & POS5A;
|
|
161
|
+
return pos5A === 連体形_ || pos5A === 終止形_;
|
|
162
|
+
}
|
|
163
|
+
function monoModalHostFacts(stemToken, previousOps) {
|
|
164
|
+
const last = previousOps[previousOps.length - 1];
|
|
165
|
+
if (last === undefined) {
|
|
166
|
+
const stemPos0 = stemToken.pos & POS0;
|
|
167
|
+
return stemPos0 === 動詞 || stemPos0 === 形容詞0 ? { past: false, desire: false } : null;
|
|
168
|
+
}
|
|
169
|
+
if (last.kind === "copula" || last.kind === "modal" || last.kind === "connective") {
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
past: hostCarriesPreModalPast(previousOps, previousOps.length),
|
|
174
|
+
desire: (last.kind === "desire" && last.form === undefined) ||
|
|
175
|
+
(last.kind === "aspect" && last.aspect === "te_hoshii")
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
function monoModalAffirmativeCopulaAt(tokens, idx, end) {
|
|
179
|
+
const copula = idx < end ? tokens[idx] : undefined;
|
|
180
|
+
if (copula === undefined || (copula.pos & POS0) !== 助動詞) {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
const pos4 = copula.pos & POS4;
|
|
184
|
+
const isPlain = pos4 === 助動詞_ダ || pos4 === 助動詞_ジャ || pos4 === 助動詞_ヤ;
|
|
185
|
+
const isPolite = pos4 === 助動詞_デス;
|
|
186
|
+
if (!isPlain && !isPolite) {
|
|
187
|
+
return null;
|
|
188
|
+
}
|
|
189
|
+
const pos5A = copula.pos & POS5A;
|
|
190
|
+
const next = idx + 1 < end ? tokens[idx + 1] : undefined;
|
|
191
|
+
if (pos5A === 意志推量形_) {
|
|
192
|
+
return { consumed: 0, polite: false, past: false };
|
|
193
|
+
}
|
|
194
|
+
if (pos5A === 連用形_) {
|
|
195
|
+
return next !== undefined && (next.pos & POS4) === 助動詞_タ && (next.pos & POS5A) !== 仮定形_
|
|
196
|
+
? { consumed: 1, polite: isPolite, past: true }
|
|
197
|
+
: null;
|
|
198
|
+
}
|
|
199
|
+
if (pos5A !== 終止形_) {
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
if (next !== undefined && (next.pos & POS0) === 助詞) {
|
|
203
|
+
const pos1 = next.pos & POS1;
|
|
204
|
+
if (pos1 === 接続助詞 ||
|
|
205
|
+
(pos1 === 副助詞 && quoteMarkerRelationAt(tokens, idx + 1, { consumers: ["tail_multi_clause"] }) === null)) {
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
if (pos1 === 終助詞 && kaMarkerRelationAt(tokens, idx + 1, ["tail_multi_clause"]) !== null) {
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return { consumed: 1, polite: isPolite, past: false };
|
|
213
|
+
}
|
|
214
|
+
function monoModalEvidenceAt(ctx, pos, lookups) {
|
|
215
|
+
const input = ctx.input;
|
|
216
|
+
if (input === undefined) {
|
|
217
|
+
return MONO_MODAL_NO_EVIDENCE;
|
|
218
|
+
}
|
|
219
|
+
const tokens = input.contextTokens ?? input.tokens;
|
|
220
|
+
return monoModalClauseEvidence(tokens, sourceIndexForInputPosition(input, pos), lookups, activeProtoLayout());
|
|
221
|
+
}
|
|
222
|
+
function monoModalAdmits(form, host, evidence, copulaPast) {
|
|
223
|
+
if (form === "mon") {
|
|
224
|
+
return true;
|
|
225
|
+
}
|
|
226
|
+
return host.desire ||
|
|
227
|
+
evidence.admirativeAdverb ||
|
|
228
|
+
(evidence.frequencyAdverb && (host.past || copulaPast));
|
|
229
|
+
}
|
|
230
|
+
export function buildMonoOp(source, form, evidence, polite) {
|
|
231
|
+
return createModalOp({
|
|
232
|
+
modal: "mono",
|
|
233
|
+
source,
|
|
234
|
+
form,
|
|
235
|
+
reading: "nominal",
|
|
236
|
+
candidates: MONO_MODAL_READING_VALUES,
|
|
237
|
+
evidence,
|
|
238
|
+
polite,
|
|
239
|
+
past: false
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
export const BARE_KAMO_EVIDENCE_SCOPE = { scope: "sentence" };
|
|
243
|
+
function bareKamoAdmissionContext(ctx, pos) {
|
|
244
|
+
const input = ctx.input;
|
|
245
|
+
if (input === undefined || ctx.lookups === undefined) {
|
|
246
|
+
return undefined;
|
|
247
|
+
}
|
|
248
|
+
const tokens = input.contextTokens ?? input.tokens;
|
|
249
|
+
const kaIndex = sourceIndexForInputPosition(input, pos);
|
|
250
|
+
const layout = activeProtoLayout() ?? undefined;
|
|
251
|
+
return {
|
|
252
|
+
tokens,
|
|
253
|
+
kaIndex,
|
|
254
|
+
clauseContainsInterrogative: clauseContainsInterrogativeBeforeKa(tokens, kaIndex, ctx.lookups, layout, BARE_KAMO_EVIDENCE_SCOPE) ||
|
|
255
|
+
clauseContainsLexicalizedInterrogativeBefore(tokens, kaIndex, ctx.lookups, layout, BARE_KAMO_EVIDENCE_SCOPE),
|
|
256
|
+
clauseContainsPredicateChoiceKa: clauseContainsPredicateChoiceKaBefore(tokens, kaIndex, layout)
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
function matchKamo(cursor, _stemToken, ctx) {
|
|
260
|
+
const { tokens, pos } = cursor;
|
|
261
|
+
return cursor.lookahead(0, c => {
|
|
262
|
+
const match = matchKamoShirenaiSequence(c, bareKamoAdmissionContext(ctx, pos));
|
|
263
|
+
if (match === null) {
|
|
264
|
+
return null;
|
|
265
|
+
}
|
|
266
|
+
const consumed = c.pos - pos;
|
|
267
|
+
return {
|
|
268
|
+
op: buildKamoOp(srcSlice(tokens, pos, consumed), match.polite, match.bare),
|
|
269
|
+
consumed
|
|
270
|
+
};
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
export function buildKamoOp(source, polite, bare = false) {
|
|
274
|
+
return createModalOp({
|
|
275
|
+
modal: "kamo",
|
|
276
|
+
source,
|
|
277
|
+
polite,
|
|
278
|
+
past: false,
|
|
279
|
+
outerLayers: 0,
|
|
280
|
+
bare
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
export function matchNoda(cursor, stemToken, ctx) {
|
|
284
|
+
const { tokens, pos, end: n } = cursor;
|
|
285
|
+
const t0 = tokens[pos];
|
|
286
|
+
const nominalizer = predicateNominalizerRelationForToken(t0, pos, {
|
|
287
|
+
requirement: "terminal_noda_marker",
|
|
288
|
+
consumers: ["tail_multi_clause"]
|
|
289
|
+
});
|
|
290
|
+
if (nominalizer?.nominalizerKind !== "no")
|
|
291
|
+
return null;
|
|
292
|
+
const previousOp = ctx.previousOps[ctx.previousOps.length - 1];
|
|
293
|
+
const previousOpIsNoda = previousOp?.kind === "modal" && previousOp.modal === "noda";
|
|
294
|
+
const t1 = tokens[pos + 1];
|
|
295
|
+
if (t1 === undefined) {
|
|
296
|
+
if (previousOpIsNoda)
|
|
297
|
+
return null;
|
|
298
|
+
return canBareNodaCarrierTerminate(pos + 1, n)
|
|
299
|
+
? { op: buildNodaOp(srcSlice(tokens, pos, 1), false), consumed: 1 }
|
|
300
|
+
: null;
|
|
301
|
+
}
|
|
302
|
+
if (isBareNodaCarrierTerminalSfpFollower(t1)) {
|
|
303
|
+
if (previousOpIsNoda)
|
|
304
|
+
return null;
|
|
305
|
+
return { op: buildNodaOp(srcSlice(tokens, pos, 1), false), consumed: 1 };
|
|
306
|
+
}
|
|
307
|
+
const fusedSupport = nominalizerCopulaSupportRelationAt(tokens, pos);
|
|
308
|
+
if (fusedSupport?.form === "fused_connective" && fusedSupport.fusedIdx === pos + 1) {
|
|
309
|
+
const noda = buildNodaOp(srcSlice(tokens, pos, 1), false);
|
|
310
|
+
const connective = createConnectiveOp({
|
|
311
|
+
connective: fusedSupport.connectiveKind === "conditional" ? "conditional" : "even_if",
|
|
312
|
+
surface: fusedSupport.connectiveSurface,
|
|
313
|
+
source: srcSlice(tokens, pos + 1, 1)
|
|
314
|
+
});
|
|
315
|
+
return { op: noda, ops: [noda, connective], consumed: 2 };
|
|
316
|
+
}
|
|
317
|
+
const t1pos4 = t1.pos & POS4;
|
|
318
|
+
const t1pos5A = t1.pos & POS5A;
|
|
319
|
+
if (t1pos5A !== 終止形_ && t1pos5A !== 連用形_) {
|
|
320
|
+
return canBareCarrierFeedFollowingTail(cursor, 1, stemToken, ctx) ||
|
|
321
|
+
bareNodaCarrierPrecedesToiuCarrier(ctx.input, cursor, pos + 1)
|
|
322
|
+
? { op: buildNodaOp(srcSlice(tokens, pos, 1), false), consumed: 1 }
|
|
323
|
+
: null;
|
|
324
|
+
}
|
|
325
|
+
if (t1pos4 === 助動詞_ダ || t1pos4 === 助動詞_ジャ || t1pos4 === 助動詞_ヤ) {
|
|
326
|
+
const support = matchNodaCopulaSupport(tokens, pos + 1);
|
|
327
|
+
if (support !== null) {
|
|
328
|
+
return {
|
|
329
|
+
op: buildNodaOp(srcSlice(tokens, pos, 1 + support.consumed), support.polite, support.pastConditional),
|
|
330
|
+
consumed: 1 + support.consumed
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
const t2 = tokens[pos + 2];
|
|
334
|
+
const isCopulaPastConditional = t1pos5A === 連用形_ &&
|
|
335
|
+
t2?.surface === "たら" &&
|
|
336
|
+
(t2.pos & (POS4 | POS5A)) === (助動詞_タ | 仮定形_);
|
|
337
|
+
return { op: buildNodaOp(srcSlice(tokens, pos, 2), false, isCopulaPastConditional), consumed: 2 };
|
|
338
|
+
}
|
|
339
|
+
if (t1pos4 === 助動詞_デス) {
|
|
340
|
+
return { op: buildNodaOp(srcSlice(tokens, pos, 2), true), consumed: 2 };
|
|
341
|
+
}
|
|
342
|
+
if (canBareCarrierFeedFollowingTail(cursor, 1, stemToken, ctx) ||
|
|
343
|
+
bareNodaCarrierPrecedesToiuCarrier(ctx.input, cursor, pos + 1)) {
|
|
344
|
+
return { op: buildNodaOp(srcSlice(tokens, pos, 1), false), consumed: 1 };
|
|
345
|
+
}
|
|
346
|
+
return null;
|
|
347
|
+
}
|
|
348
|
+
function matchNodaDatteHearsay(cursor, _stemToken, _ctx) {
|
|
349
|
+
const { tokens, pos } = cursor;
|
|
350
|
+
const t0 = tokens[pos];
|
|
351
|
+
const nominalizer = predicateNominalizerRelationForToken(t0, pos, {
|
|
352
|
+
requirement: "terminal_noda_marker",
|
|
353
|
+
consumers: ["tail_multi_clause"]
|
|
354
|
+
});
|
|
355
|
+
if (nominalizer?.nominalizerKind !== "no")
|
|
356
|
+
return null;
|
|
357
|
+
const copula = tokens[pos + 1];
|
|
358
|
+
const datte = tokens[pos + 2];
|
|
359
|
+
const copulaPos4 = (copula?.pos ?? 0) & POS4;
|
|
360
|
+
const copulaPos5A = (copula?.pos ?? 0) & POS5A;
|
|
361
|
+
if (copula === undefined ||
|
|
362
|
+
copulaPos5A !== 終止形_ ||
|
|
363
|
+
datte === undefined ||
|
|
364
|
+
(datte.pos & POS0) !== 助詞) {
|
|
365
|
+
return null;
|
|
366
|
+
}
|
|
367
|
+
const hearsayMarker = copulaPos4 === 助動詞_ダ || copulaPos4 === 助動詞_デス ? "って"
|
|
368
|
+
: copulaPos4 === 助動詞_ヤ ? "て"
|
|
369
|
+
: null;
|
|
370
|
+
if (hearsayMarker === null || datte.surface !== hearsayMarker) {
|
|
371
|
+
return null;
|
|
372
|
+
}
|
|
373
|
+
if (tokens[pos + 3] !== undefined) {
|
|
374
|
+
return null;
|
|
375
|
+
}
|
|
376
|
+
return {
|
|
377
|
+
op: buildSoudaHearsayOp(srcSlice(tokens, pos, 3), copulaPos4 === 助動詞_デス, "hearsay"),
|
|
378
|
+
consumed: 3
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
function canBareNodaCarrierTerminate(pos, end) {
|
|
382
|
+
return pos >= end;
|
|
383
|
+
}
|
|
384
|
+
function matchNodaCopulaSupport(tokens, dePos) {
|
|
385
|
+
const relation = nominalizerCopulaSupportRelationAt(tokens, dePos - 1);
|
|
386
|
+
if (relation === null || relation.form !== "separate" || relation.copulaIdx !== dePos) {
|
|
387
|
+
return null;
|
|
388
|
+
}
|
|
389
|
+
const support = tokens[relation.supportIdx];
|
|
390
|
+
const next = tokens[dePos + 2];
|
|
391
|
+
const politeConjecture = next !== undefined &&
|
|
392
|
+
(next.pos & (POS4 | POS5A)) === (助動詞_マス | 意志推量形_);
|
|
393
|
+
const pastConditional = (support.pos & POS5) === 連用形_促音便 &&
|
|
394
|
+
next?.surface === "たら" &&
|
|
395
|
+
(next.pos & (POS4 | POS5A)) === (助動詞_タ | 仮定形_);
|
|
396
|
+
return {
|
|
397
|
+
consumed: politeConjecture ? 3 : 2,
|
|
398
|
+
polite: relation.polite,
|
|
399
|
+
pastConditional
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
function bareNodaCarrierPrecedesToiuCarrier(input, cursor, pos) {
|
|
403
|
+
const context = input === undefined
|
|
404
|
+
? { tokens: cursor.tokens, index: pos }
|
|
405
|
+
: contextAlignedPosition(input, cursor, pos);
|
|
406
|
+
return toiuAttributiveTailEnd(context.tokens, context.index, context.tokens.length) !== null;
|
|
407
|
+
}
|
|
408
|
+
function canBareCarrierFeedFollowingTail(cursor, offset, stemToken, ctx) {
|
|
409
|
+
const { tokens, pos: basePos } = cursor;
|
|
410
|
+
const pos = basePos + offset;
|
|
411
|
+
const next = tokens[pos];
|
|
412
|
+
if (next === undefined)
|
|
413
|
+
return false;
|
|
414
|
+
if (cursor.lookahead(offset, c => tryMatchModal(c, stemToken, ctx)) !== null) {
|
|
415
|
+
return true;
|
|
416
|
+
}
|
|
417
|
+
if (cursor.lookahead(offset, isTailFinalQuestionSfpStart)) {
|
|
418
|
+
return true;
|
|
419
|
+
}
|
|
420
|
+
if (isOutgoingQuoteMarkerPosition(ctx.input, cursor, pos)) {
|
|
421
|
+
return true;
|
|
422
|
+
}
|
|
423
|
+
const cls = classifyAux(next, tokens[pos + 1]).classifications;
|
|
424
|
+
if (cls.includes("negation")) {
|
|
425
|
+
return false;
|
|
426
|
+
}
|
|
427
|
+
return cls.includes("conjecture") ||
|
|
428
|
+
cls.includes("conjecture_polite") ||
|
|
429
|
+
cls.includes("rashii") ||
|
|
430
|
+
cls.includes("connective");
|
|
431
|
+
}
|
|
432
|
+
function canBareBoundModalCarrierTerminate(pos, end) {
|
|
433
|
+
return pos >= end;
|
|
434
|
+
}
|
|
435
|
+
export function startsKamoModal(cursor) {
|
|
436
|
+
const { tokens, pos } = cursor;
|
|
437
|
+
return kaMarkerRelationAt(tokens, pos, ["tail_multi_clause"]) !== null &&
|
|
438
|
+
tokens[pos + 1]?.surface === "も" &&
|
|
439
|
+
tokens[pos + 2] !== undefined &&
|
|
440
|
+
isKamoShirenaiLemma(tokens[pos + 2]);
|
|
441
|
+
}
|
|
442
|
+
export function buildNodaOp(source, polite, past = false) {
|
|
443
|
+
return createModalOp({
|
|
444
|
+
modal: "noda",
|
|
445
|
+
source,
|
|
446
|
+
polite,
|
|
447
|
+
past
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
export function wakeExplanatoryCopulaPolite(t0, t1, options = {}) {
|
|
451
|
+
if (!isWakeNounToken(t0) || t1 === undefined) {
|
|
452
|
+
return null;
|
|
453
|
+
}
|
|
454
|
+
const t1pos5A = t1.pos & POS5A;
|
|
455
|
+
const formAccepted = options.terminalOnly === true
|
|
456
|
+
? t1pos5A === 終止形_
|
|
457
|
+
: t1pos5A === 終止形_ || t1pos5A === 連用形_;
|
|
458
|
+
if (!formAccepted) {
|
|
459
|
+
return null;
|
|
460
|
+
}
|
|
461
|
+
const t1pos4 = t1.pos & POS4;
|
|
462
|
+
if (t1pos4 === 助動詞_ダ) {
|
|
463
|
+
return false;
|
|
464
|
+
}
|
|
465
|
+
if (t1pos4 === 助動詞_デス) {
|
|
466
|
+
return true;
|
|
467
|
+
}
|
|
468
|
+
return null;
|
|
469
|
+
}
|
|
470
|
+
export function wakeExplanatoryCopulaConjecture(t0, t1) {
|
|
471
|
+
if (!isWakeNounToken(t0) || t1 === undefined) {
|
|
472
|
+
return null;
|
|
473
|
+
}
|
|
474
|
+
if ((t1.pos & POS5A) !== 意志推量形_) {
|
|
475
|
+
return null;
|
|
476
|
+
}
|
|
477
|
+
const t1pos4 = t1.pos & POS4;
|
|
478
|
+
if (t1pos4 === 助動詞_ダ) {
|
|
479
|
+
return false;
|
|
480
|
+
}
|
|
481
|
+
if (t1pos4 === 助動詞_デス) {
|
|
482
|
+
return true;
|
|
483
|
+
}
|
|
484
|
+
return null;
|
|
485
|
+
}
|
|
486
|
+
function matchWake(cursor, stemToken, ctx) {
|
|
487
|
+
const { tokens, pos } = cursor;
|
|
488
|
+
const t0 = tokens[pos];
|
|
489
|
+
if (!isWakeNounToken(t0))
|
|
490
|
+
return null;
|
|
491
|
+
const t1 = tokens[pos + 1];
|
|
492
|
+
if (t1 === undefined) {
|
|
493
|
+
return null;
|
|
494
|
+
}
|
|
495
|
+
const t1pos5A = t1.pos & POS5A;
|
|
496
|
+
if ((t1.pos & POS4) === 助動詞_ダ &&
|
|
497
|
+
t1pos5A === 連用形_ &&
|
|
498
|
+
copulaDeMarkerRelationForToken(t1, pos + 1, { consumers: ["tail_multi_clause"] }) !== null &&
|
|
499
|
+
isPredicativeCopulaSupportVerbAt(tokens, pos + 2)) {
|
|
500
|
+
return {
|
|
501
|
+
op: buildWakeOp(srcSlice(tokens, pos, 3), "explanatory", "affirmative", false),
|
|
502
|
+
consumed: 3
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
const explanatoryPolite = wakeExplanatoryCopulaPolite(t0, t1);
|
|
506
|
+
if (explanatoryPolite !== null) {
|
|
507
|
+
return { op: buildWakeOp(srcSlice(tokens, pos, 2), "explanatory", "affirmative", explanatoryPolite), consumed: 2 };
|
|
508
|
+
}
|
|
509
|
+
const directNegEnd = matchNegationEnding(tokens, pos + 1, { allowAttributive: true, allowConjecture: true });
|
|
510
|
+
if (directNegEnd !== null) {
|
|
511
|
+
return modalMatchWithFusedConjecture({
|
|
512
|
+
op: buildWakeOp(srcSlice(tokens, pos, 1 + directNegEnd.consumed), "rhetorical_no_way", "negative", directNegEnd.polite),
|
|
513
|
+
consumed: 1 + directNegEnd.consumed
|
|
514
|
+
}, directNegEnd, tokens, pos);
|
|
515
|
+
}
|
|
516
|
+
if (isAruVerbToken(t1) &&
|
|
517
|
+
(t1pos5A === 終止形_ || t1pos5A === 連体形_)) {
|
|
518
|
+
const afterAru = tokens[pos + 2];
|
|
519
|
+
if (afterAru === undefined ||
|
|
520
|
+
isQuestionParticleToken(afterAru) ||
|
|
521
|
+
(afterAru.pos & POS0) === 補助記号 ||
|
|
522
|
+
(afterAru.pos & POS0) === 記号) {
|
|
523
|
+
return {
|
|
524
|
+
op: buildWakeOp(srcSlice(tokens, pos, 2), "rhetorical_possibility", "affirmative", false),
|
|
525
|
+
consumed: 2
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
if (t1.surface === "が" && (t1.pos & POS1) === 格助詞) {
|
|
530
|
+
const negEnd = matchNegationEnding(tokens, pos + 2, { allowAttributive: true, allowConjecture: true });
|
|
531
|
+
if (negEnd !== null) {
|
|
532
|
+
return modalMatchWithFusedConjecture({
|
|
533
|
+
op: buildWakeOp(srcSlice(tokens, pos, 2 + negEnd.consumed), "rhetorical_no_way", "negative", negEnd.polite),
|
|
534
|
+
consumed: 2 + negEnd.consumed
|
|
535
|
+
}, negEnd, tokens, pos);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
const wakeDewa = dewaScopeBridgeRelationAt(tokens, pos + 1, {
|
|
539
|
+
anchorIdx: pos,
|
|
540
|
+
consumers: ["tail_multi_clause"]
|
|
541
|
+
});
|
|
542
|
+
if (wakeDewa?.focusParticle === "wa") {
|
|
543
|
+
const negEnd = matchNegationEnding(tokens, wakeDewa.span.endExclusive, { allowAttributive: true, allowConjecture: true });
|
|
544
|
+
if (negEnd !== null) {
|
|
545
|
+
const consumed = wakeDewa.span.endExclusive - pos + negEnd.consumed;
|
|
546
|
+
return modalMatchWithFusedConjecture({
|
|
547
|
+
op: buildWakeOp(srcSlice(tokens, pos, consumed), "partial_negation", "negative", negEnd.polite),
|
|
548
|
+
consumed
|
|
549
|
+
}, negEnd, tokens, pos);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
if (t1.surface === "でも" && (t1.pos & POS1) === 副助詞) {
|
|
553
|
+
const negEnd = matchNegationEnding(tokens, pos + 2, { allowAttributive: true, allowConjecture: true });
|
|
554
|
+
if (negEnd !== null) {
|
|
555
|
+
return modalMatchWithFusedConjecture({
|
|
556
|
+
op: buildWakeOp(srcSlice(tokens, pos, 2 + negEnd.consumed), "weakened_partial_negation", "negative", negEnd.polite),
|
|
557
|
+
consumed: 2 + negEnd.consumed
|
|
558
|
+
}, negEnd, tokens, pos);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
if (canBareCarrierFeedFollowingTail(cursor, 1, stemToken, ctx)) {
|
|
562
|
+
return { op: buildWakeOp(srcSlice(tokens, pos, 1), "explanatory", "affirmative", false), consumed: 1 };
|
|
563
|
+
}
|
|
564
|
+
return null;
|
|
565
|
+
}
|
|
566
|
+
export function buildWakeOp(source, variant, polarity, polite) {
|
|
567
|
+
return createModalOp({
|
|
568
|
+
modal: "wake",
|
|
569
|
+
source,
|
|
570
|
+
variant,
|
|
571
|
+
polarity,
|
|
572
|
+
polite,
|
|
573
|
+
past: false
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
function matchMai(cursor) {
|
|
577
|
+
const { tokens, pos } = cursor;
|
|
578
|
+
const t0 = tokens[pos];
|
|
579
|
+
if (t0 === undefined ||
|
|
580
|
+
((t0.pos & POS4) !== 助動詞_マイ && (t0.pos & POS4) !== 文語助動詞_マジ)) {
|
|
581
|
+
return null;
|
|
582
|
+
}
|
|
583
|
+
const t0pos5A = t0.pos & POS5A;
|
|
584
|
+
if (t0pos5A !== 終止形_ && t0pos5A !== 連体形_ && t0pos5A !== 連用形_) {
|
|
585
|
+
return null;
|
|
586
|
+
}
|
|
587
|
+
return { op: buildMaiOp(srcSlice(tokens, pos, 1)), consumed: 1 };
|
|
588
|
+
}
|
|
589
|
+
export function buildMaiOp(source) {
|
|
590
|
+
return createModalOp({
|
|
591
|
+
modal: "mai",
|
|
592
|
+
source,
|
|
593
|
+
polite: false,
|
|
594
|
+
past: false
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
export function buildLimitNegationOp(source, focus, polite) {
|
|
598
|
+
return createModalOp({
|
|
599
|
+
modal: "limit_negation",
|
|
600
|
+
source,
|
|
601
|
+
focus,
|
|
602
|
+
polite,
|
|
603
|
+
past: false
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
export function matchLimitNegationModal(cursor) {
|
|
607
|
+
const { tokens, pos } = cursor;
|
|
608
|
+
const frame = quoteFocusLimitNegationTailStartingAt(cursor.fork());
|
|
609
|
+
if (frame === null) {
|
|
610
|
+
return null;
|
|
611
|
+
}
|
|
612
|
+
const negEnd = matchNegationEnding(tokens, frame.limitVerbIdx + 1, { allowAttributive: true });
|
|
613
|
+
if (negEnd === null || frame.limitVerbIdx + 1 + negEnd.consumed > cursor.end) {
|
|
614
|
+
return null;
|
|
615
|
+
}
|
|
616
|
+
const consumed = frame.limitVerbIdx + 1 + negEnd.consumed - pos;
|
|
617
|
+
cursor.advance(consumed);
|
|
618
|
+
return buildLimitNegationOp(srcSlice(tokens, pos, consumed), frame.marker.focusSurface === "も" ? "mo" : "wa", negEnd.polite);
|
|
619
|
+
}
|
|
620
|
+
function matchSoudaHearsay(cursor, stemToken, ctx) {
|
|
621
|
+
const { tokens, pos, end: n } = cursor;
|
|
622
|
+
const t0 = tokens[pos];
|
|
623
|
+
if (t0 === undefined)
|
|
624
|
+
return null;
|
|
625
|
+
const isDirectAfterStem = pos >= 1 && tokens[pos - 1] === stemToken;
|
|
626
|
+
const stemPos5A = stemToken.pos & POS5A;
|
|
627
|
+
const recoveredYotaiStem = t0.surface === "そう" &&
|
|
628
|
+
(t0.pos & POS0) === 副詞 &&
|
|
629
|
+
isDirectAfterStem &&
|
|
630
|
+
(stemPos5A === 連用形_ || stemPos5A === 語幹_);
|
|
631
|
+
if (!isSoudaAuxiliaryStemToken(t0) && !recoveredYotaiStem)
|
|
632
|
+
return null;
|
|
633
|
+
let reading = "hearsay";
|
|
634
|
+
if (isDirectAfterStem) {
|
|
635
|
+
if (stemPos5A === 連用形_ || stemPos5A === 語幹_ || isBareNaAdjYotaiStemToken(stemToken)) {
|
|
636
|
+
reading = "yotai";
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
else if (isDirectAfterYotaiCarrier(ctx.previousOps, pos)) {
|
|
640
|
+
reading = "yotai";
|
|
641
|
+
}
|
|
642
|
+
const t1 = pos + 1 < n ? tokens[pos + 1] : undefined;
|
|
643
|
+
if (t1 === undefined) {
|
|
644
|
+
return { op: buildSoudaHearsayOp(srcSlice(tokens, pos, 1), false, reading), consumed: 1 };
|
|
645
|
+
}
|
|
646
|
+
const t1pos4 = t1.pos & POS4;
|
|
647
|
+
const t1pos5A = t1.pos & POS5A;
|
|
648
|
+
const t1IsPoliteCopula = t1pos4 === 助動詞_デス;
|
|
649
|
+
const t1IsAdnominalCopula = t1pos5A === 連体形_ &&
|
|
650
|
+
((t1.surface === "な" && t1pos4 === 助動詞_ダ) || t1IsPoliteCopula);
|
|
651
|
+
const nominalizerSupportsAdnominalCopula = t1IsAdnominalCopula &&
|
|
652
|
+
predicateNominalizerRelationForToken(tokens[pos + 2], pos + 2, {
|
|
653
|
+
requirement: "tail_connective_marker",
|
|
654
|
+
consumers: ["tail_multi_clause"]
|
|
655
|
+
})?.nominalizerKind === "no";
|
|
656
|
+
const terminalNodaSupportsAdnominalCopula = t1IsAdnominalCopula &&
|
|
657
|
+
t1.surface === "な" &&
|
|
658
|
+
predicateNominalizerRelationForToken(tokens[pos + 2], pos + 2, {
|
|
659
|
+
requirement: "terminal_noda_marker",
|
|
660
|
+
consumers: ["tail_multi_clause"]
|
|
661
|
+
})?.nominalizerKind === "no";
|
|
662
|
+
const adnominalHeadTerminal = t1IsAdnominalCopula &&
|
|
663
|
+
reading === "yotai" &&
|
|
664
|
+
t1.surface === "な" &&
|
|
665
|
+
ctx.input?.allowAdnominalCopulaTerminal === true &&
|
|
666
|
+
pos + 2 >= n &&
|
|
667
|
+
!nominalizerSupportsAdnominalCopula;
|
|
668
|
+
if (t1IsAdnominalCopula &&
|
|
669
|
+
(nominalizerSupportsAdnominalCopula ||
|
|
670
|
+
terminalNodaSupportsAdnominalCopula ||
|
|
671
|
+
(reading === "yotai" &&
|
|
672
|
+
t1.surface === "な" &&
|
|
673
|
+
ctx.lookups !== undefined &&
|
|
674
|
+
attributiveCopulaTailFollows(tokens, pos + 2, ctx.lookups)) ||
|
|
675
|
+
adnominalHeadTerminal ||
|
|
676
|
+
(reading === "hearsay" &&
|
|
677
|
+
t1.surface === "な" &&
|
|
678
|
+
utteranceClosesAtChunkPosition(cursor, pos + 2, ctx.input)))) {
|
|
679
|
+
return {
|
|
680
|
+
op: buildSoudaHearsayOp(srcSlice(tokens, pos, 2), t1IsPoliteCopula, reading),
|
|
681
|
+
consumed: 2,
|
|
682
|
+
...(adnominalHeadTerminal ? { terminal: "attributive" } : {})
|
|
683
|
+
};
|
|
684
|
+
}
|
|
685
|
+
if (t1pos5A !== 終止形_ && t1pos5A !== 連用形_) {
|
|
686
|
+
const bareFocusNegation = reading === "yotai"
|
|
687
|
+
? soudaAppearanceFocusNegationAt(tokens, pos + 1)
|
|
688
|
+
: null;
|
|
689
|
+
if (bareFocusNegation !== null) {
|
|
690
|
+
const consumed = 2 + bareFocusNegation.supportConsumed;
|
|
691
|
+
return {
|
|
692
|
+
op: buildSoudaHearsayOp(srcSlice(tokens, pos, consumed), false, reading, bareFocusNegation.particle),
|
|
693
|
+
consumed
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
return canBareCarrierFeedFollowingTail(cursor, 1, stemToken, ctx) ||
|
|
697
|
+
terminalDiscourseSfpRunClosesUtterance(cursor, ctx.input, 1)
|
|
698
|
+
? { op: buildSoudaHearsayOp(srcSlice(tokens, pos, 1), false, reading), consumed: 1 }
|
|
699
|
+
: null;
|
|
700
|
+
}
|
|
701
|
+
if (t1pos4 === 助動詞_ダ &&
|
|
702
|
+
t1pos5A === 連用形_ &&
|
|
703
|
+
copulaNiMarkerRelationForToken(t1, pos + 1, { consumers: ["tail_multi_clause"] }) !== null) {
|
|
704
|
+
const focusNegation = soudaAppearanceFocusNegationAt(tokens, pos + 2);
|
|
705
|
+
if (focusNegation !== null) {
|
|
706
|
+
const consumed = 3 + focusNegation.supportConsumed;
|
|
707
|
+
return {
|
|
708
|
+
op: buildSoudaHearsayOp(srcSlice(tokens, pos, consumed), false, reading, focusNegation.particle),
|
|
709
|
+
consumed
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
const soudaDewa = dewaScopeBridgeRelationAt(tokens, pos + 1, {
|
|
714
|
+
anchorIdx: pos,
|
|
715
|
+
consumers: ["tail_multi_clause"]
|
|
716
|
+
});
|
|
717
|
+
if (soudaDewa?.focusParticle === "wa" &&
|
|
718
|
+
matchNegationEnding(tokens, soudaDewa.span.endExclusive, { allowAttributive: true }) !== null) {
|
|
719
|
+
const consumed = soudaDewa.span.endExclusive - pos;
|
|
720
|
+
return { op: buildSoudaHearsayOp(srcSlice(tokens, pos, consumed), false, reading), consumed };
|
|
721
|
+
}
|
|
722
|
+
if (t1pos4 === 助動詞_ダ &&
|
|
723
|
+
t1pos5A === 連用形_ &&
|
|
724
|
+
(copulaDeMarkerRelationForToken(t1, pos + 1, { consumers: ["tail_multi_clause"] }) !== null ||
|
|
725
|
+
copulaNiMarkerRelationForToken(t1, pos + 1, { consumers: ["tail_multi_clause"] }) !== null) &&
|
|
726
|
+
isPredicativeCopulaSupportVerbAt(tokens, pos + 2)) {
|
|
727
|
+
return { op: buildSoudaHearsayOp(srcSlice(tokens, pos, 3), false, reading), consumed: 3 };
|
|
728
|
+
}
|
|
729
|
+
if (isAssertiveCopulaMarkerToken(t1)) {
|
|
730
|
+
return { op: buildSoudaHearsayOp(srcSlice(tokens, pos, 2), false, reading), consumed: 2 };
|
|
731
|
+
}
|
|
732
|
+
if (t1pos4 === 助動詞_デス) {
|
|
733
|
+
return { op: buildSoudaHearsayOp(srcSlice(tokens, pos, 2), true, reading), consumed: 2 };
|
|
734
|
+
}
|
|
735
|
+
return null;
|
|
736
|
+
}
|
|
737
|
+
function isBareNaAdjYotaiStemToken(stemToken) {
|
|
738
|
+
return isNaAdjCapable(stemToken);
|
|
739
|
+
}
|
|
740
|
+
function isNegationStemYotaiCarrier(op) {
|
|
741
|
+
if (op.kind !== "negation")
|
|
742
|
+
return false;
|
|
743
|
+
const last = op.source.tokens[op.source.tokens.length - 1];
|
|
744
|
+
return last !== undefined && isNaiOrNuToken(last) && (last.pos & POS5A) === 語幹_;
|
|
745
|
+
}
|
|
746
|
+
function isDirectAfterYotaiCarrier(previousOps, pos) {
|
|
747
|
+
const previous = previousOps[previousOps.length - 1];
|
|
748
|
+
if (previous === undefined)
|
|
749
|
+
return false;
|
|
750
|
+
if (previous.kind === "tense" || previous.kind === "polite") {
|
|
751
|
+
return false;
|
|
752
|
+
}
|
|
753
|
+
if (previous.kind === "negation" && !isNegationStemYotaiCarrier(previous)) {
|
|
754
|
+
return false;
|
|
755
|
+
}
|
|
756
|
+
const lastIdx = previous.source.tokenIndices[previous.source.tokenIndices.length - 1];
|
|
757
|
+
if (lastIdx !== pos - 1)
|
|
758
|
+
return false;
|
|
759
|
+
const lastToken = previous.source.tokens[previous.source.tokens.length - 1];
|
|
760
|
+
const pos5A = (lastToken?.pos ?? 0) & POS5A;
|
|
761
|
+
return pos5A === 連用形_ || pos5A === 語幹_;
|
|
762
|
+
}
|
|
763
|
+
export function buildSoudaHearsayOp(source, polite, reading, negationFocusParticle) {
|
|
764
|
+
return createModalOp({
|
|
765
|
+
modal: "souda_hearsay",
|
|
766
|
+
source,
|
|
767
|
+
reading,
|
|
768
|
+
candidates: [reading],
|
|
769
|
+
polite,
|
|
770
|
+
past: false,
|
|
771
|
+
...(negationFocusParticle === undefined ? {} : { negationFocusParticle })
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
function soudaAppearanceFocusNegationAt(tokens, focusIdx) {
|
|
775
|
+
const focus = tokens[focusIdx];
|
|
776
|
+
if (focus === undefined || (focus.pos & POS01) !== 助詞_係助詞) {
|
|
777
|
+
return null;
|
|
778
|
+
}
|
|
779
|
+
const particle = negationFocusParticleForMarker(focus.surface);
|
|
780
|
+
if (particle === null || matchNegationEnding(tokens, focusIdx + 1, { allowAttributive: true }) === null) {
|
|
781
|
+
return null;
|
|
782
|
+
}
|
|
783
|
+
return {
|
|
784
|
+
particle,
|
|
785
|
+
supportConsumed: isPredicativeCopulaSupportVerbAt(tokens, focusIdx + 1) ? 1 : 0
|
|
786
|
+
};
|
|
787
|
+
}
|
|
788
|
+
function matchTonokotoHearsay(cursor, _stemToken, _ctx) {
|
|
789
|
+
const { tokens, pos } = cursor;
|
|
790
|
+
const token = tokens[pos];
|
|
791
|
+
if (token === undefined || token.dictionaryForm !== "とのことだ") {
|
|
792
|
+
return null;
|
|
793
|
+
}
|
|
794
|
+
if (token.surface !== "とのことだ" && token.surface !== "とのことです") {
|
|
795
|
+
return null;
|
|
796
|
+
}
|
|
797
|
+
return {
|
|
798
|
+
op: buildSoudaHearsayOp(srcSlice(tokens, pos, 1), token.surface === "とのことです", "hearsay"),
|
|
799
|
+
consumed: 1
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
function matchTsumori(cursor, stemToken, ctx) {
|
|
803
|
+
const { tokens, pos, end: n } = cursor;
|
|
804
|
+
const t0 = tokens[pos];
|
|
805
|
+
if (t0 === undefined || !isTsumoriHeadToken(t0))
|
|
806
|
+
return null;
|
|
807
|
+
const t1 = tokens[pos + 1];
|
|
808
|
+
if (t1 === undefined) {
|
|
809
|
+
return canBareBoundModalCarrierTerminate(pos + 1, n)
|
|
810
|
+
? { op: buildTsumoriOp(srcSlice(tokens, pos, 1), false, "affirmative"), consumed: 1 }
|
|
811
|
+
: null;
|
|
812
|
+
}
|
|
813
|
+
const t1pos4 = t1.pos & POS4;
|
|
814
|
+
const t1pos5A = t1.pos & POS5A;
|
|
815
|
+
if (t1.surface === "は" && (t1.pos & POS1) === 係助詞) {
|
|
816
|
+
const negEnd = matchNegationEnding(tokens, pos + 2, { allowAttributive: true });
|
|
817
|
+
if (negEnd !== null) {
|
|
818
|
+
return {
|
|
819
|
+
op: buildTsumoriOp(srcSlice(tokens, pos, 2 + negEnd.consumed), negEnd.polite, "topic_negative"),
|
|
820
|
+
consumed: 2 + negEnd.consumed
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
const tsumoriDewa = dewaScopeBridgeRelationAt(tokens, pos + 1, {
|
|
825
|
+
anchorIdx: pos,
|
|
826
|
+
consumers: ["tail_multi_clause"]
|
|
827
|
+
});
|
|
828
|
+
if (tsumoriDewa?.focusParticle === "wa") {
|
|
829
|
+
const negEnd = matchNegationEnding(tokens, tsumoriDewa.span.endExclusive, { allowAttributive: true });
|
|
830
|
+
if (negEnd !== null) {
|
|
831
|
+
const consumed = tsumoriDewa.span.endExclusive - pos + negEnd.consumed;
|
|
832
|
+
return {
|
|
833
|
+
op: buildTsumoriOp(srcSlice(tokens, pos, consumed), negEnd.polite, "copula_negative"),
|
|
834
|
+
consumed
|
|
835
|
+
};
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
if (isCopulaJaNegativeBridgeToken(t1)) {
|
|
839
|
+
const negEnd = matchNegationEnding(tokens, pos + 2, { allowAttributive: true });
|
|
840
|
+
if (negEnd !== null) {
|
|
841
|
+
return {
|
|
842
|
+
op: buildTsumoriOp(srcSlice(tokens, pos, 2 + negEnd.consumed), negEnd.polite, "copula_negative"),
|
|
843
|
+
consumed: 2 + negEnd.consumed
|
|
844
|
+
};
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
if (copulaDeMarkerRelationForToken(t1, pos + 1, { consumers: ["tail_multi_clause"] }) !== null &&
|
|
848
|
+
t1pos4 === 助動詞_ダ &&
|
|
849
|
+
t1pos5A === 連用形_ &&
|
|
850
|
+
!isObligationSpanStartingAtToken(tokens, pos + 2, ctx.elidedColloquialObligationContext ?? "terminal")) {
|
|
851
|
+
const negEnd = matchNegationEnding(tokens, pos + 2, { allowAttributive: true });
|
|
852
|
+
if (negEnd !== null) {
|
|
853
|
+
return {
|
|
854
|
+
op: buildTsumoriOp(srcSlice(tokens, pos, 2 + negEnd.consumed), negEnd.polite, "copula_negative"),
|
|
855
|
+
consumed: 2 + negEnd.consumed
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
if (t1pos5A !== 終止形_ && t1pos5A !== 連用形_) {
|
|
860
|
+
return canBareCarrierFeedFollowingTail(cursor, 1, stemToken, ctx) ||
|
|
861
|
+
terminalDiscourseSfpRunClosesUtterance(cursor, ctx.input, 1)
|
|
862
|
+
? { op: buildTsumoriOp(srcSlice(tokens, pos, 1), false, "affirmative"), consumed: 1 }
|
|
863
|
+
: null;
|
|
864
|
+
}
|
|
865
|
+
if (t1pos4 === 助動詞_ダ) {
|
|
866
|
+
return { op: buildTsumoriOp(srcSlice(tokens, pos, 2), false, "affirmative"), consumed: 2 };
|
|
867
|
+
}
|
|
868
|
+
if (t1pos4 === 助動詞_デス) {
|
|
869
|
+
return { op: buildTsumoriOp(srcSlice(tokens, pos, 2), true, "affirmative"), consumed: 2 };
|
|
870
|
+
}
|
|
871
|
+
if (canBareCarrierFeedFollowingTail(cursor, 1, stemToken, ctx) ||
|
|
872
|
+
terminalDiscourseSfpRunClosesUtterance(cursor, ctx.input, 1)) {
|
|
873
|
+
return { op: buildTsumoriOp(srcSlice(tokens, pos, 1), false, "affirmative"), consumed: 1 };
|
|
874
|
+
}
|
|
875
|
+
return null;
|
|
876
|
+
}
|
|
877
|
+
function isTsumoriHeadToken(token) {
|
|
878
|
+
if ((token.pos & POS0) !== 名詞)
|
|
879
|
+
return false;
|
|
880
|
+
const head = token.dictionaryForm || token.surface;
|
|
881
|
+
return head === "つもり" || head === "積もり";
|
|
882
|
+
}
|
|
883
|
+
export function buildTsumoriOp(source, polite, variant) {
|
|
884
|
+
return createModalOp({
|
|
885
|
+
modal: "tsumori",
|
|
886
|
+
source,
|
|
887
|
+
variant,
|
|
888
|
+
reading: "intention",
|
|
889
|
+
candidates: ["intention"],
|
|
890
|
+
polarity: variant === "affirmative" ? "affirmative" : "negative",
|
|
891
|
+
polite,
|
|
892
|
+
past: false
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
function matchTokoro(cursor, stemToken, ctx) {
|
|
896
|
+
const { tokens, pos } = cursor;
|
|
897
|
+
const t0 = tokens[pos];
|
|
898
|
+
if (t0 === undefined || t0.surface !== "ところ" || (t0.pos & POS0) !== 名詞)
|
|
899
|
+
return null;
|
|
900
|
+
const t1 = tokens[pos + 1];
|
|
901
|
+
if (t1 === undefined)
|
|
902
|
+
return null;
|
|
903
|
+
const t1pos4 = t1.pos & POS4;
|
|
904
|
+
const t1pos5A = t1.pos & POS5A;
|
|
905
|
+
if (isTokoroAdnominalCopulaBridge(t1) &&
|
|
906
|
+
tokoroAdnominalCopulaTailFollows(tokens, pos + 2, ctx.lookups)) {
|
|
907
|
+
return { op: buildTokoroOp(srcSlice(tokens, pos, 2), t1pos4 === 助動詞_デス), consumed: 2 };
|
|
908
|
+
}
|
|
909
|
+
const focusBridge = cursor.lookahead(1, c => matchScopeBridgeTail(c, null));
|
|
910
|
+
if (focusBridge !== null && focusBridge.polarity === "affirmative") {
|
|
911
|
+
return { op: buildTokoroOp(srcSlice(tokens, pos, 1), false), consumed: 1 };
|
|
912
|
+
}
|
|
913
|
+
if (t1pos5A !== 終止形_ && t1pos5A !== 連用形_) {
|
|
914
|
+
return canBareCarrierFeedFollowingTail(cursor, 1, stemToken, ctx)
|
|
915
|
+
? { op: buildTokoroOp(srcSlice(tokens, pos, 1), false), consumed: 1 }
|
|
916
|
+
: null;
|
|
917
|
+
}
|
|
918
|
+
if (copulaDeMarkerRelationForToken(t1, pos + 1, { consumers: ["tail_multi_clause"] }) !== null &&
|
|
919
|
+
t1pos5A === 連用形_) {
|
|
920
|
+
if (isPredicativeCopulaSupportVerbAt(tokens, pos + 2)) {
|
|
921
|
+
return { op: buildTokoroOp(srcSlice(tokens, pos, 3), false), consumed: 3 };
|
|
922
|
+
}
|
|
923
|
+
const support = tokens[pos + 2];
|
|
924
|
+
if (isAffirmativeCopulaSupportVerbToken(support)) {
|
|
925
|
+
if ((support.pos & POS5) === 連用形_促音便) {
|
|
926
|
+
return { op: buildTokoroOp(srcSlice(tokens, pos, 3), false), consumed: 3 };
|
|
927
|
+
}
|
|
928
|
+
if ((support.pos & POS5A) === 連用形_ && renyouChuushiPauseFollowsSupport(cursor, ctx, pos + 3)) {
|
|
929
|
+
const tokoro = buildTokoroOp(srcSlice(tokens, pos, 3), false);
|
|
930
|
+
const connective = createConnectiveOp({
|
|
931
|
+
connective: "listing",
|
|
932
|
+
surface: DEARI_LISTING_CONNECTIVE_SURFACE,
|
|
933
|
+
source: srcSlice(tokens, pos + 1, 2)
|
|
934
|
+
});
|
|
935
|
+
return { op: tokoro, ops: [tokoro, connective], consumed: 3 };
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
if (t1pos4 === 助動詞_ダ) {
|
|
940
|
+
return { op: buildTokoroOp(srcSlice(tokens, pos, 2), false), consumed: 2 };
|
|
941
|
+
}
|
|
942
|
+
if (t1pos4 === 助動詞_デス) {
|
|
943
|
+
return { op: buildTokoroOp(srcSlice(tokens, pos, 2), true), consumed: 2 };
|
|
944
|
+
}
|
|
945
|
+
if (canBareCarrierFeedFollowingTail(cursor, 1, stemToken, ctx)) {
|
|
946
|
+
return { op: buildTokoroOp(srcSlice(tokens, pos, 1), false), consumed: 1 };
|
|
947
|
+
}
|
|
948
|
+
return null;
|
|
949
|
+
}
|
|
950
|
+
function isTokoroAdnominalCopulaBridge(token) {
|
|
951
|
+
if (token === undefined) {
|
|
952
|
+
return false;
|
|
953
|
+
}
|
|
954
|
+
const pos4 = token.pos & POS4;
|
|
955
|
+
const pos5A = token.pos & POS5A;
|
|
956
|
+
return (pos4 === 助動詞_ダ || pos4 === 助動詞_デス) &&
|
|
957
|
+
pos5A === 連体形_;
|
|
958
|
+
}
|
|
959
|
+
function tokoroAdnominalCopulaTailFollows(tokens, pos, lookups) {
|
|
960
|
+
return attributiveCopulaTailFollows(tokens, pos, lookups) ||
|
|
961
|
+
terminalNodaCarrierFollowsAdnominalCopula(tokens, pos);
|
|
962
|
+
}
|
|
963
|
+
export function buildTokoroOp(source, polite) {
|
|
964
|
+
return createModalOp({
|
|
965
|
+
modal: "tokoro",
|
|
966
|
+
source,
|
|
967
|
+
variant: "temporal",
|
|
968
|
+
candidates: ["temporal", "place", "intention"],
|
|
969
|
+
reading: "temporal",
|
|
970
|
+
polite,
|
|
971
|
+
past: false
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
const MODAL_MATCHERS = [
|
|
975
|
+
matchHazu, matchKamo, matchNodaDatteHearsay, matchNoda,
|
|
976
|
+
matchWake, matchMai, matchYouda, matchSoudaHearsay, matchTonokotoHearsay, matchTsumori, matchTokoro, matchMono
|
|
977
|
+
];
|
|
978
|
+
function tryMatchModal(cursor, stemToken, ctx) {
|
|
979
|
+
for (const matcher of MODAL_MATCHERS) {
|
|
980
|
+
const match = matcher(cursor, stemToken, ctx);
|
|
981
|
+
if (match !== null)
|
|
982
|
+
return match;
|
|
983
|
+
}
|
|
984
|
+
return null;
|
|
985
|
+
}
|
|
986
|
+
export function matchModalAtCursor(cursor, stemToken, ctx) {
|
|
987
|
+
const match = tryMatchModal(cursor, stemToken, ctx);
|
|
988
|
+
if (match === null) {
|
|
989
|
+
return null;
|
|
990
|
+
}
|
|
991
|
+
cursor.advance(match.consumed);
|
|
992
|
+
return {
|
|
993
|
+
op: match.op,
|
|
994
|
+
...(match.ops === undefined ? {} : { ops: match.ops }),
|
|
995
|
+
...(match.terminal === undefined ? {} : { terminal: match.terminal })
|
|
996
|
+
};
|
|
997
|
+
}
|
|
998
|
+
export const MONO_MODAL_SAMPLE_NO_EVIDENCE = MONO_MODAL_NO_EVIDENCE;
|