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.
Files changed (762) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.en.md +24 -21
  3. package/README.md +66 -73
  4. package/data/config/lookup_tables.toml +9 -4
  5. package/dist/analyzer/config.js +1 -3
  6. package/dist/analyzer/connect.d.ts +1 -1
  7. package/dist/analyzer/connect.js +2 -1
  8. package/dist/analyzer/dictionary-provider.d.ts +2 -0
  9. package/dist/analyzer/dictionary-provider.js +3 -0
  10. package/dist/analyzer/haru-dictionary-provider.js +17 -6
  11. package/dist/analyzer/node-dictionary-provider.d.ts +19 -8
  12. package/dist/analyzer/node-dictionary-provider.js +109 -48
  13. package/dist/analyzer/node-helpers.js +12 -18
  14. package/dist/analyzer/page-cached-source.d.ts +59 -0
  15. package/dist/analyzer/page-cached-source.js +157 -0
  16. package/dist/analyzer-lexicon.js +6 -1
  17. package/dist/default-provider.d.ts +1 -1
  18. package/dist/default-provider.js +14 -6
  19. package/dist/dictionary/derivation.d.ts +0 -1
  20. package/dist/dictionary/morpheme.js +13 -7
  21. package/dist/dictionary/pattern.js +1 -1
  22. package/dist/dictionary/sense-normalization.js +3 -3
  23. package/dist/generator/aux-map.d.ts +1 -0
  24. package/dist/generator/aux-map.js +1 -1
  25. package/dist/generator/conjugator.d.ts +0 -1
  26. package/dist/generator/conjugator.js +0 -3
  27. package/dist/generator/numerals.d.ts +0 -1
  28. package/dist/generator/numerals.js +0 -3
  29. package/dist/pipeline/assembler/affix-helpers.d.ts +14 -0
  30. package/dist/pipeline/assembler/affix-helpers.js +154 -0
  31. package/dist/pipeline/assembler/content-override.d.ts +3 -0
  32. package/dist/pipeline/assembler/content-override.js +79 -0
  33. package/dist/pipeline/assembler/copula-focus-plan.d.ts +10 -0
  34. package/dist/pipeline/assembler/copula-focus-plan.js +32 -0
  35. package/dist/pipeline/assembler/copula-helpers.d.ts +31 -0
  36. package/dist/pipeline/assembler/copula-helpers.js +192 -0
  37. package/dist/pipeline/assembler/lexical-layout-hypothesis.d.ts +59 -0
  38. package/dist/pipeline/assembler/lexical-layout-hypothesis.js +357 -0
  39. package/dist/pipeline/assembler/light-verb-projection.d.ts +21 -0
  40. package/dist/pipeline/assembler/light-verb-projection.js +43 -0
  41. package/dist/pipeline/assembler/nande-reason.d.ts +4 -0
  42. package/dist/pipeline/assembler/nande-reason.js +162 -0
  43. package/dist/pipeline/assembler/particle-helpers.d.ts +10 -0
  44. package/dist/pipeline/assembler/particle-helpers.js +57 -0
  45. package/dist/pipeline/assembler/quantity-spans.d.ts +24 -0
  46. package/dist/pipeline/assembler/quantity-spans.js +58 -0
  47. package/dist/pipeline/assembler/question-plan.d.ts +5 -0
  48. package/dist/pipeline/assembler/question-plan.js +121 -0
  49. package/dist/pipeline/assembler/quote-helpers.d.ts +11 -0
  50. package/dist/pipeline/assembler/quote-helpers.js +67 -0
  51. package/dist/pipeline/assembler.d.ts +47 -31
  52. package/dist/pipeline/assembler.js +1219 -3234
  53. package/dist/pipeline/assembly-content-span.d.ts +59 -0
  54. package/dist/pipeline/assembly-content-span.js +149 -0
  55. package/dist/pipeline/attributive.d.ts +2 -2
  56. package/dist/pipeline/attributive.js +2 -5
  57. package/dist/pipeline/candidate-runtime.d.ts +2 -30
  58. package/dist/pipeline/candidate-runtime.js +4 -125
  59. package/dist/pipeline/clause-layout/adverbial-predicate.d.ts +22 -0
  60. package/dist/pipeline/clause-layout/adverbial-predicate.js +180 -0
  61. package/dist/pipeline/clause-layout/attributive-boundaries.d.ts +12 -0
  62. package/dist/pipeline/clause-layout/attributive-boundaries.js +325 -0
  63. package/dist/pipeline/clause-layout/boundary-detection.d.ts +100 -0
  64. package/dist/pipeline/clause-layout/boundary-detection.js +729 -0
  65. package/dist/pipeline/clause-layout/boundary-event-common.d.ts +8 -0
  66. package/dist/pipeline/clause-layout/boundary-event-common.js +50 -0
  67. package/dist/pipeline/clause-layout/boundary-settlement.d.ts +40 -0
  68. package/dist/pipeline/clause-layout/boundary-settlement.js +534 -0
  69. package/dist/pipeline/clause-layout/chuushi-closure.js +1 -2
  70. package/dist/pipeline/clause-layout/connective-boundaries.d.ts +34 -0
  71. package/dist/pipeline/clause-layout/connective-boundaries.js +1049 -0
  72. package/dist/pipeline/clause-layout/final-layout.d.ts +155 -0
  73. package/dist/pipeline/clause-layout/final-layout.js +544 -0
  74. package/dist/pipeline/clause-layout/index.d.ts +5 -597
  75. package/dist/pipeline/clause-layout/index.js +69 -6576
  76. package/dist/pipeline/clause-layout/juncture-verdict.d.ts +1 -3
  77. package/dist/pipeline/clause-layout/layout-types.d.ts +142 -0
  78. package/dist/pipeline/clause-layout/layout-types.js +16 -0
  79. package/dist/pipeline/clause-layout/lexical-adverbial-affiliation.d.ts +1 -1
  80. package/dist/pipeline/clause-layout/navigation.d.ts +48 -0
  81. package/dist/pipeline/clause-layout/navigation.js +264 -0
  82. package/dist/pipeline/clause-layout/nominal-anchor-evidence.d.ts +57 -0
  83. package/dist/pipeline/clause-layout/nominal-anchor-evidence.js +180 -0
  84. package/dist/pipeline/clause-layout/nominal-anchors.d.ts +9 -0
  85. package/dist/pipeline/clause-layout/nominal-anchors.js +318 -0
  86. package/dist/pipeline/clause-layout/nominal-binding.d.ts +1 -1
  87. package/dist/pipeline/clause-layout/nominal-binding.js +1 -1
  88. package/dist/pipeline/clause-layout/nominal-frame-reach.d.ts +7 -0
  89. package/dist/pipeline/clause-layout/nominal-frame-reach.js +77 -0
  90. package/dist/pipeline/clause-layout/particle-phrase-copula.d.ts +1 -1
  91. package/dist/pipeline/clause-layout/phrase-enumeration.d.ts +1 -1
  92. package/dist/pipeline/clause-layout/phrase-enumeration.js +2 -1
  93. package/dist/pipeline/clause-layout/predicate-ownership.d.ts +22 -0
  94. package/dist/pipeline/clause-layout/predicate-ownership.js +323 -0
  95. package/dist/pipeline/clause-layout/predicate-parallel.d.ts +2 -1
  96. package/dist/pipeline/clause-layout/predicate-parallel.js +16 -1
  97. package/dist/pipeline/clause-layout/predicate-shape.d.ts +49 -0
  98. package/dist/pipeline/clause-layout/predicate-shape.js +369 -0
  99. package/dist/pipeline/clause-layout/predicate-token-shape.d.ts +15 -0
  100. package/dist/pipeline/clause-layout/predicate-token-shape.js +142 -0
  101. package/dist/pipeline/clause-layout/prenominal-head-reach.d.ts +29 -0
  102. package/dist/pipeline/clause-layout/prenominal-head-reach.js +349 -0
  103. package/dist/pipeline/clause-layout/proto-layout.d.ts +144 -0
  104. package/dist/pipeline/clause-layout/proto-layout.js +327 -0
  105. package/dist/pipeline/clause-layout/proto-state.d.ts +2 -1
  106. package/dist/pipeline/clause-layout/punctuated-copula.d.ts +1 -1
  107. package/dist/pipeline/clause-layout/punctuation.d.ts +8 -0
  108. package/dist/pipeline/clause-layout/punctuation.js +33 -0
  109. package/dist/pipeline/clause-layout/quote-classification.d.ts +48 -0
  110. package/dist/pipeline/clause-layout/quote-classification.js +430 -0
  111. package/dist/pipeline/clause-layout/quote-delimiters.d.ts +2 -0
  112. package/dist/pipeline/clause-layout/quote-delimiters.js +16 -0
  113. package/dist/pipeline/clause-layout/renyou-verb-reading.d.ts +1 -1
  114. package/dist/pipeline/clause-layout/speech-act.js +1 -1
  115. package/dist/pipeline/clause-layout/token-evidence.d.ts +11 -0
  116. package/dist/pipeline/clause-layout/token-evidence.js +41 -0
  117. package/dist/pipeline/clause-layout/trivia.d.ts +5 -0
  118. package/dist/pipeline/clause-layout/trivia.js +18 -1
  119. package/dist/pipeline/clause-layout/utterance-boundaries.d.ts +41 -0
  120. package/dist/pipeline/clause-layout/utterance-boundaries.js +627 -0
  121. package/dist/pipeline/clause-layout/vocative.d.ts +5 -0
  122. package/dist/pipeline/clause-layout/vocative.js +91 -0
  123. package/dist/pipeline/clause-layout/whitespace-attributive-reading.d.ts +1 -1
  124. package/dist/pipeline/clause-layout/whitespace-attributive-reading.js +4 -1
  125. package/dist/pipeline/commitment/adverbial-adjunct-routing.d.ts +3 -0
  126. package/dist/pipeline/commitment/adverbial-adjunct-routing.js +109 -0
  127. package/dist/pipeline/commitment/benefactive-span-hydration.d.ts +5 -0
  128. package/dist/pipeline/commitment/benefactive-span-hydration.js +49 -0
  129. package/dist/pipeline/commitment/candidate-projection.d.ts +29 -0
  130. package/dist/pipeline/commitment/candidate-projection.js +512 -0
  131. package/dist/pipeline/commitment/connective-refinement.d.ts +8 -0
  132. package/dist/pipeline/commitment/connective-refinement.js +152 -0
  133. package/dist/pipeline/commitment/deferred-reanalysis.d.ts +1 -1
  134. package/dist/pipeline/commitment/final-sense-sync.d.ts +8 -0
  135. package/dist/pipeline/commitment/final-sense-sync.js +264 -0
  136. package/dist/pipeline/commitment/head-owner-candidate-selection.d.ts +15 -0
  137. package/dist/pipeline/commitment/head-owner-candidate-selection.js +158 -0
  138. package/dist/pipeline/commitment/particle-roles.d.ts +1 -1
  139. package/dist/pipeline/commitment/particle-roles.js +546 -398
  140. package/dist/pipeline/commitment/passive-class.d.ts +1 -1
  141. package/dist/pipeline/commitment/passive-class.js +2 -3
  142. package/dist/pipeline/commitment/quantity-span-commitment.d.ts +4 -0
  143. package/dist/pipeline/commitment/quantity-span-commitment.js +37 -0
  144. package/dist/pipeline/commitment/quote-refinement.d.ts +6 -0
  145. package/dist/pipeline/commitment/quote-refinement.js +130 -0
  146. package/dist/pipeline/commitment/role-case-shadow.d.ts +0 -4
  147. package/dist/pipeline/commitment/role-case-shadow.js +0 -3
  148. package/dist/pipeline/commitment/semantic-frame.d.ts +1 -1
  149. package/dist/pipeline/commitment/semantic-frame.js +2 -3
  150. package/dist/pipeline/commitment/span-evidence.d.ts +2 -3
  151. package/dist/pipeline/commitment/span-evidence.js +7 -18
  152. package/dist/pipeline/commitment/stem-candidate-selection.d.ts +24 -0
  153. package/dist/pipeline/commitment/stem-candidate-selection.js +663 -0
  154. package/dist/pipeline/commitment/te-connective-resolution.d.ts +1 -1
  155. package/dist/pipeline/commitment/te-connective-resolution.js +0 -1
  156. package/dist/pipeline/commitment/types.d.ts +1 -1
  157. package/dist/pipeline/commitment/types.js +1 -1
  158. package/dist/pipeline/commitment/voice-reading-resolution.d.ts +1 -1
  159. package/dist/pipeline/commitment/voice-reading-resolution.js +117 -34
  160. package/dist/pipeline/compounds/compound-tail-tokens.d.ts +12 -0
  161. package/dist/pipeline/compounds/compound-tail-tokens.js +37 -0
  162. package/dist/pipeline/compounds/compound-translation-candidates.d.ts +49 -0
  163. package/dist/pipeline/compounds/compound-translation-candidates.js +154 -0
  164. package/dist/pipeline/compounds/compound-verbs.js +4 -9
  165. package/dist/pipeline/compounds/index.d.ts +24 -29
  166. package/dist/pipeline/compounds/index.js +361 -383
  167. package/dist/pipeline/content-resolver/postaux-pattern-rendering.d.ts +0 -2
  168. package/dist/pipeline/content-resolver/postaux-pattern-rendering.js +1 -5
  169. package/dist/pipeline/content-resolver/types.d.ts +0 -4
  170. package/dist/pipeline/content-resolver.js +641 -492
  171. package/dist/pipeline/context.d.ts +2 -1
  172. package/dist/pipeline/context.js +4 -3
  173. package/dist/pipeline/core.d.ts +8 -95
  174. package/dist/pipeline/core.js +1339 -7183
  175. package/dist/pipeline/deferred-commitment.d.ts +2 -17
  176. package/dist/pipeline/deferred-commitment.js +406 -2353
  177. package/dist/pipeline/demo-discourse.d.ts +1 -1
  178. package/dist/pipeline/fallback/index.d.ts +0 -1
  179. package/dist/pipeline/fallback/index.js +3 -7
  180. package/dist/pipeline/fallback/orphan-unit-absorption.d.ts +4 -0
  181. package/dist/pipeline/fallback/orphan-unit-absorption.js +57 -0
  182. package/dist/pipeline/fallback/unsupported-raw.d.ts +0 -2
  183. package/dist/pipeline/fallback/unsupported-raw.js +0 -10
  184. package/dist/pipeline/head-tail/boundary/clause-start.js +1 -10
  185. package/dist/pipeline/head-tail/boundary/ka-ownership.d.ts +3 -2
  186. package/dist/pipeline/head-tail/boundary/ka-ownership.js +16 -9
  187. package/dist/pipeline/head-tail/boundary/marker.js +1 -1
  188. package/dist/pipeline/head-tail/boundary/punctuation.d.ts +0 -1
  189. package/dist/pipeline/head-tail/boundary/punctuation.js +1 -6
  190. package/dist/pipeline/head-tail/boundary/quote-marker.js +1 -1
  191. package/dist/pipeline/head-tail/candidate/collect.d.ts +3 -3
  192. package/dist/pipeline/head-tail/candidate/context.d.ts +1 -1
  193. package/dist/pipeline/head-tail/candidate/context.js +1 -1
  194. package/dist/pipeline/head-tail/candidate/evidence.d.ts +0 -2
  195. package/dist/pipeline/head-tail/candidate/evidence.js +0 -22
  196. package/dist/pipeline/head-tail/candidate/owner-payload.d.ts +1 -1
  197. package/dist/pipeline/head-tail/candidate/semantic-classifiers.d.ts +2 -1
  198. package/dist/pipeline/head-tail/data/honorific-formulaic-arm-table.d.ts +0 -1
  199. package/dist/pipeline/head-tail/data/honorific-formulaic-arm-table.js +0 -3
  200. package/dist/pipeline/head-tail/data/quoted-reporting-sets.d.ts +2 -0
  201. package/dist/pipeline/head-tail/data/quoted-reporting-sets.js +4 -0
  202. package/dist/pipeline/head-tail/grammar.d.ts +0 -1
  203. package/dist/pipeline/head-tail/head/adapters/nominal/commit.js +3 -2
  204. package/dist/pipeline/head-tail/head/adapters/nominal/grammar.d.ts +2 -1
  205. package/dist/pipeline/head-tail/head/adapters/nominal/integration.d.ts +2 -2
  206. package/dist/pipeline/head-tail/head/adapters/nominal/integration.js +6 -6
  207. package/dist/pipeline/head-tail/head/adapters/nominal/owner-arbitration.d.ts +1 -1
  208. package/dist/pipeline/head-tail/head/adapters/nominal/parser.d.ts +1 -2
  209. package/dist/pipeline/head-tail/head/adapters/nominal/parser.js +20 -24
  210. package/dist/pipeline/head-tail/head/adapters/nominal/plan-lifecycle.d.ts +1 -1
  211. package/dist/pipeline/head-tail/head/adapters/nominal/renyou-nominal-head.js +2 -2
  212. package/dist/pipeline/head-tail/integration/content-head-dispatch.d.ts +5 -6
  213. package/dist/pipeline/head-tail/integration/content-head-dispatch.js +2 -5
  214. package/dist/pipeline/head-tail/integration/copula-focus-adjunct.js +1 -1
  215. package/dist/pipeline/head-tail/integration/copula-host-chain.js +1 -1
  216. package/dist/pipeline/head-tail/integration/honorific-formulaic-host.d.ts +25 -0
  217. package/dist/pipeline/head-tail/integration/honorific-formulaic-host.js +142 -0
  218. package/dist/pipeline/head-tail/integration/nominal-assembly.d.ts +2 -2
  219. package/dist/pipeline/head-tail/integration/nominal-assembly.js +1 -1
  220. package/dist/pipeline/head-tail/integration/particle-phrase-copula.d.ts +1 -1
  221. package/dist/pipeline/head-tail/integration/semantic-carrier-predicate.js +3 -20
  222. package/dist/pipeline/head-tail/integration/tail-assembly.d.ts +2 -3
  223. package/dist/pipeline/head-tail/integration/tail-assembly.js +20 -145
  224. package/dist/pipeline/head-tail/lifecycle/commit-context.d.ts +1 -1
  225. package/dist/pipeline/head-tail/lifecycle/head-tail-render-plan.d.ts +1 -1
  226. package/dist/pipeline/head-tail/lifecycle/hooks.d.ts +2 -3
  227. package/dist/pipeline/head-tail/lifecycle/hooks.js +0 -9
  228. package/dist/pipeline/head-tail/lifecycle/plan-context.d.ts +1 -1
  229. package/dist/pipeline/head-tail/lifecycle/plan-context.js +1 -1
  230. package/dist/pipeline/head-tail/lifecycle/registry.d.ts +3 -4
  231. package/dist/pipeline/head-tail/lifecycle/registry.js +1 -4
  232. package/dist/pipeline/head-tail/lifecycle/render.js +2 -2
  233. package/dist/pipeline/head-tail/line-memo.d.ts +1 -1
  234. package/dist/pipeline/head-tail/line-memo.js +25 -6
  235. package/dist/pipeline/head-tail/tail/chain.d.ts +3 -3
  236. package/dist/pipeline/head-tail/tail/families/tokoro-semantics.d.ts +0 -1
  237. package/dist/pipeline/head-tail/tail/families/tokoro-semantics.js +2 -1
  238. package/dist/pipeline/head-tail/tail/families/youda-semantics.js +1 -4
  239. package/dist/pipeline/head-tail/tail/postverb-events.d.ts +0 -180
  240. package/dist/pipeline/head-tail/tail/postverb-events.js +2 -2249
  241. package/dist/pipeline/head-tail/tail/postverb-tail-classifier.js +3 -4
  242. package/dist/pipeline/head-tail/tail/predicate-root/aspect-semantics.d.ts +10 -8
  243. package/dist/pipeline/head-tail/tail/predicate-root/aspect-semantics.js +2 -55
  244. package/dist/pipeline/head-tail/tail/predicate-root/benefactive-hydration.d.ts +1 -1
  245. package/dist/pipeline/head-tail/tail/predicate-root/benefactive-hydration.js +1 -18
  246. package/dist/pipeline/head-tail/tail/predicate-root/boundary-semantics.js +4 -2
  247. package/dist/pipeline/head-tail/tail/predicate-root/classifiers/causative-aux.d.ts +4 -0
  248. package/dist/pipeline/head-tail/tail/predicate-root/classifiers/causative-aux.js +11 -0
  249. package/dist/pipeline/head-tail/tail/predicate-root/classifiers/copula-concessive.d.ts +1 -1
  250. package/dist/pipeline/head-tail/tail/predicate-root/classifiers/copula-concessive.js +14 -3
  251. package/dist/pipeline/head-tail/tail/predicate-root/classifiers/tokens.d.ts +0 -2
  252. package/dist/pipeline/head-tail/tail/predicate-root/classifiers/tokens.js +3 -12
  253. package/dist/pipeline/head-tail/tail/predicate-root/commit.d.ts +2 -1
  254. package/dist/pipeline/head-tail/tail/predicate-root/commit.js +1 -1
  255. package/dist/pipeline/head-tail/tail/predicate-root/commitment-bridge.d.ts +1 -1
  256. package/dist/pipeline/head-tail/tail/predicate-root/connective-ops.d.ts +9 -0
  257. package/dist/pipeline/head-tail/tail/predicate-root/connective-ops.js +69 -0
  258. package/dist/pipeline/head-tail/tail/predicate-root/connective-render.d.ts +7 -0
  259. package/dist/pipeline/head-tail/tail/predicate-root/connective-render.js +52 -0
  260. package/dist/pipeline/head-tail/tail/predicate-root/connective-surface-lookup.d.ts +11 -0
  261. package/dist/pipeline/head-tail/tail/predicate-root/connective-surface-lookup.js +114 -0
  262. package/dist/pipeline/head-tail/tail/predicate-root/derivational-host-base.js +1 -1
  263. package/dist/pipeline/head-tail/tail/predicate-root/grammar.d.ts +2 -14
  264. package/dist/pipeline/head-tail/tail/predicate-root/grammar.js +19 -128
  265. package/dist/pipeline/head-tail/tail/predicate-root/head-contract-table.d.ts +2 -1
  266. package/dist/pipeline/head-tail/tail/predicate-root/head-contract-table.js +1 -1
  267. package/dist/pipeline/head-tail/tail/predicate-root/head-hydration.js +2 -17
  268. package/dist/pipeline/head-tail/tail/predicate-root/inspect.d.ts +2 -8
  269. package/dist/pipeline/head-tail/tail/predicate-root/inspect.js +12 -16
  270. package/dist/pipeline/head-tail/tail/predicate-root/integration/attributive-boundary.d.ts +35 -0
  271. package/dist/pipeline/head-tail/tail/predicate-root/integration/attributive-boundary.js +1079 -0
  272. package/dist/pipeline/head-tail/tail/predicate-root/integration/clause-boundaries.d.ts +69 -0
  273. package/dist/pipeline/head-tail/tail/predicate-root/integration/clause-boundaries.js +2972 -0
  274. package/dist/pipeline/head-tail/tail/predicate-root/integration/contracts.d.ts +118 -0
  275. package/dist/pipeline/head-tail/tail/predicate-root/integration/end-boundary-inference.d.ts +22 -0
  276. package/dist/pipeline/head-tail/tail/predicate-root/integration/end-boundary-inference.js +698 -0
  277. package/dist/pipeline/head-tail/tail/predicate-root/integration/head-admission.d.ts +39 -0
  278. package/dist/pipeline/head-tail/tail/predicate-root/integration/head-admission.js +689 -0
  279. package/dist/pipeline/head-tail/tail/predicate-root/integration/head-profiles.d.ts +13 -0
  280. package/dist/pipeline/head-tail/tail/predicate-root/integration/head-profiles.js +138 -0
  281. package/dist/pipeline/head-tail/tail/predicate-root/integration/parse-clause.d.ts +60 -0
  282. package/dist/pipeline/head-tail/tail/predicate-root/integration/parse-clause.js +2013 -0
  283. package/dist/pipeline/head-tail/tail/predicate-root/integration/predicate-evidence.d.ts +15 -0
  284. package/dist/pipeline/head-tail/tail/predicate-root/integration/predicate-evidence.js +109 -0
  285. package/dist/pipeline/head-tail/tail/predicate-root/integration/predicate-start-evidence.d.ts +48 -0
  286. package/dist/pipeline/head-tail/tail/predicate-root/integration/predicate-start-evidence.js +608 -0
  287. package/dist/pipeline/head-tail/tail/predicate-root/integration/readiness.d.ts +1 -1
  288. package/dist/pipeline/head-tail/tail/predicate-root/integration/readiness.js +3 -2
  289. package/dist/pipeline/head-tail/tail/predicate-root/integration/stem-candidates.d.ts +177 -0
  290. package/dist/pipeline/head-tail/tail/predicate-root/integration/stem-candidates.js +1885 -0
  291. package/dist/pipeline/head-tail/tail/predicate-root/integration/tail-arbitration.d.ts +13 -0
  292. package/dist/pipeline/head-tail/tail/predicate-root/integration/tail-arbitration.js +283 -0
  293. package/dist/pipeline/head-tail/tail/predicate-root/integration/tail-chunk-scan-end.d.ts +8 -0
  294. package/dist/pipeline/head-tail/tail/predicate-root/integration/tail-chunk-scan-end.js +389 -0
  295. package/dist/pipeline/head-tail/tail/predicate-root/integration/zero-head.js +3 -2
  296. package/dist/pipeline/head-tail/tail/predicate-root/integration.d.ts +9 -166
  297. package/dist/pipeline/head-tail/tail/predicate-root/integration.js +254 -10644
  298. package/dist/pipeline/head-tail/tail/predicate-root/matchers/connective-tail.d.ts +51 -0
  299. package/dist/pipeline/head-tail/tail/predicate-root/matchers/connective-tail.js +808 -0
  300. package/dist/pipeline/head-tail/tail/predicate-root/matchers/connective.d.ts +1 -1
  301. package/dist/pipeline/head-tail/tail/predicate-root/matchers/connective.js +5 -3
  302. package/dist/pipeline/head-tail/tail/predicate-root/matchers/copula-tail.d.ts +22 -0
  303. package/dist/pipeline/head-tail/tail/predicate-root/matchers/copula-tail.js +156 -0
  304. package/dist/pipeline/head-tail/tail/predicate-root/matchers/copula.d.ts +8 -2
  305. package/dist/pipeline/head-tail/tail/predicate-root/matchers/copula.js +177 -51
  306. package/dist/pipeline/head-tail/tail/predicate-root/matchers/lexical-idioms.d.ts +37 -0
  307. package/dist/pipeline/head-tail/tail/predicate-root/matchers/lexical-idioms.js +959 -0
  308. package/dist/pipeline/head-tail/tail/predicate-root/matchers/likeness-modal.d.ts +15 -0
  309. package/dist/pipeline/head-tail/tail/predicate-root/matchers/likeness-modal.js +327 -0
  310. package/dist/pipeline/head-tail/tail/predicate-root/matchers/modal-tail.d.ts +44 -0
  311. package/dist/pipeline/head-tail/tail/predicate-root/matchers/modal-tail.js +998 -0
  312. package/dist/pipeline/head-tail/tail/predicate-root/matchers/obligation-tail.d.ts +20 -0
  313. package/dist/pipeline/head-tail/tail/predicate-root/matchers/obligation-tail.js +424 -0
  314. package/dist/pipeline/head-tail/tail/predicate-root/matchers/obligation.d.ts +1 -1
  315. package/dist/pipeline/head-tail/tail/predicate-root/matchers/obligation.js +1 -1
  316. package/dist/pipeline/head-tail/tail/predicate-root/matchers/postverb-operator.d.ts +25 -0
  317. package/dist/pipeline/head-tail/tail/predicate-root/matchers/postverb-operator.js +722 -0
  318. package/dist/pipeline/head-tail/tail/predicate-root/matchers/predicate-projection-connective.js +143 -9
  319. package/dist/pipeline/head-tail/tail/predicate-root/matchers/predicate-quote.d.ts +44 -0
  320. package/dist/pipeline/head-tail/tail/predicate-root/matchers/predicate-quote.js +856 -0
  321. package/dist/pipeline/head-tail/tail/predicate-root/matchers/projection-tail.d.ts +45 -0
  322. package/dist/pipeline/head-tail/tail/predicate-root/matchers/projection-tail.js +573 -0
  323. package/dist/pipeline/head-tail/tail/predicate-root/matchers/quantity-extent.d.ts +2 -1
  324. package/dist/pipeline/head-tail/tail/predicate-root/matchers/quantity-extent.js +1 -1
  325. package/dist/pipeline/head-tail/tail/predicate-root/matchers/te-aspect.d.ts +23 -0
  326. package/dist/pipeline/head-tail/tail/predicate-root/matchers/te-aspect.js +598 -0
  327. package/dist/pipeline/head-tail/tail/predicate-root/matchers/te-host.d.ts +11 -0
  328. package/dist/pipeline/head-tail/tail/predicate-root/matchers/te-host.js +52 -0
  329. package/dist/pipeline/head-tail/tail/predicate-root/matchers/terminal-sfp.d.ts +24 -0
  330. package/dist/pipeline/head-tail/tail/predicate-root/matchers/terminal-sfp.js +873 -0
  331. package/dist/pipeline/head-tail/tail/predicate-root/mid-chain-connective-license.js +2 -1
  332. package/dist/pipeline/head-tail/tail/predicate-root/nominal-host-phrase.d.ts +0 -1
  333. package/dist/pipeline/head-tail/tail/predicate-root/nominal-host-phrase.js +0 -3
  334. package/dist/pipeline/head-tail/tail/predicate-root/op-builders.d.ts +5 -1
  335. package/dist/pipeline/head-tail/tail/predicate-root/op-builders.js +21 -0
  336. package/dist/pipeline/head-tail/tail/predicate-root/operator-head.d.ts +1 -3
  337. package/dist/pipeline/head-tail/tail/predicate-root/operator-head.js +0 -16
  338. package/dist/pipeline/head-tail/tail/predicate-root/parse-boundary-hint.d.ts +1 -1
  339. package/dist/pipeline/head-tail/tail/predicate-root/parse-closure.d.ts +15 -0
  340. package/dist/pipeline/head-tail/tail/predicate-root/parse-closure.js +158 -0
  341. package/dist/pipeline/head-tail/tail/predicate-root/parse-coordinates.d.ts +10 -0
  342. package/dist/pipeline/head-tail/tail/predicate-root/parse-coordinates.js +29 -0
  343. package/dist/pipeline/head-tail/tail/predicate-root/parse-stem.d.ts +14 -0
  344. package/dist/pipeline/head-tail/tail/predicate-root/parse-stem.js +150 -0
  345. package/dist/pipeline/head-tail/tail/predicate-root/parse-tail.d.ts +40 -0
  346. package/dist/pipeline/head-tail/tail/predicate-root/parse-tail.js +1625 -0
  347. package/dist/pipeline/head-tail/tail/predicate-root/parser.d.ts +26 -137
  348. package/dist/pipeline/head-tail/tail/predicate-root/parser.js +153 -9225
  349. package/dist/pipeline/head-tail/tail/predicate-root/plan-lifecycle.d.ts +2 -2
  350. package/dist/pipeline/head-tail/tail/predicate-root/postverb-host-attachment.d.ts +8 -0
  351. package/dist/pipeline/head-tail/tail/predicate-root/postverb-host-attachment.js +105 -0
  352. package/dist/pipeline/head-tail/tail/predicate-root/production-admission-contract.js +261 -215
  353. package/dist/pipeline/head-tail/tail/predicate-root/production-claim-access.d.ts +0 -1
  354. package/dist/pipeline/head-tail/tail/predicate-root/production-claim-access.js +0 -3
  355. package/dist/pipeline/head-tail/tail/predicate-root/production-families/attributive-change.d.ts +3 -0
  356. package/dist/pipeline/head-tail/tail/predicate-root/production-families/attributive-change.js +327 -0
  357. package/dist/pipeline/head-tail/tail/predicate-root/production-families/attributive.d.ts +54 -0
  358. package/dist/pipeline/head-tail/tail/predicate-root/production-families/attributive.js +1212 -0
  359. package/dist/pipeline/head-tail/tail/predicate-root/production-families/chain-patterns.d.ts +191 -0
  360. package/dist/pipeline/head-tail/tail/predicate-root/production-families/chain-patterns.js +127 -0
  361. package/dist/pipeline/head-tail/tail/predicate-root/production-families/clause-chain.d.ts +17 -0
  362. package/dist/pipeline/head-tail/tail/predicate-root/production-families/clause-chain.js +1071 -0
  363. package/dist/pipeline/head-tail/tail/predicate-root/production-families/conditional-carriers.d.ts +4 -0
  364. package/dist/pipeline/head-tail/tail/predicate-root/production-families/conditional-carriers.js +366 -0
  365. package/dist/pipeline/head-tail/tail/predicate-root/production-families/confirmation.d.ts +3 -0
  366. package/dist/pipeline/head-tail/tail/predicate-root/production-families/confirmation.js +289 -0
  367. package/dist/pipeline/head-tail/tail/predicate-root/production-families/copula.d.ts +8 -0
  368. package/dist/pipeline/head-tail/tail/predicate-root/production-families/copula.js +868 -0
  369. package/dist/pipeline/head-tail/tail/predicate-root/production-families/desiderative.d.ts +4 -0
  370. package/dist/pipeline/head-tail/tail/predicate-root/production-families/desiderative.js +414 -0
  371. package/dist/pipeline/head-tail/tail/predicate-root/production-families/exemplification.d.ts +2 -0
  372. package/dist/pipeline/head-tail/tail/predicate-root/production-families/exemplification.js +290 -0
  373. package/dist/pipeline/head-tail/tail/predicate-root/production-families/imperative.d.ts +6 -0
  374. package/dist/pipeline/head-tail/tail/predicate-root/production-families/imperative.js +468 -0
  375. package/dist/pipeline/head-tail/tail/predicate-root/production-families/mid-chain-quote.d.ts +4 -0
  376. package/dist/pipeline/head-tail/tail/predicate-root/production-families/mid-chain-quote.js +558 -0
  377. package/dist/pipeline/head-tail/tail/predicate-root/production-families/nominalization.d.ts +6 -0
  378. package/dist/pipeline/head-tail/tail/predicate-root/production-families/nominalization.js +332 -0
  379. package/dist/pipeline/head-tail/tail/predicate-root/production-families/nominalized-quote.d.ts +3 -0
  380. package/dist/pipeline/head-tail/tail/predicate-root/production-families/nominalized-quote.js +393 -0
  381. package/dist/pipeline/head-tail/tail/predicate-root/production-families/normalization.d.ts +7 -0
  382. package/dist/pipeline/head-tail/tail/predicate-root/production-families/normalization.js +334 -0
  383. package/dist/pipeline/head-tail/tail/predicate-root/production-families/potential.d.ts +3 -0
  384. package/dist/pipeline/head-tail/tail/predicate-root/production-families/potential.js +304 -0
  385. package/dist/pipeline/head-tail/tail/predicate-root/production-families/reason-and-sequence.d.ts +6 -0
  386. package/dist/pipeline/head-tail/tail/predicate-root/production-families/reason-and-sequence.js +687 -0
  387. package/dist/pipeline/head-tail/tail/predicate-root/production-families/request.d.ts +4 -0
  388. package/dist/pipeline/head-tail/tail/predicate-root/production-families/request.js +1013 -0
  389. package/dist/pipeline/head-tail/tail/predicate-root/production-families/shared.d.ts +25 -0
  390. package/dist/pipeline/head-tail/tail/predicate-root/production-families/shared.js +53 -0
  391. package/dist/pipeline/head-tail/tail/predicate-root/production-families/subordination.d.ts +5 -0
  392. package/dist/pipeline/head-tail/tail/predicate-root/production-families/subordination.js +318 -0
  393. package/dist/pipeline/head-tail/tail/predicate-root/production-families/terminal.d.ts +14 -0
  394. package/dist/pipeline/head-tail/tail/predicate-root/production-families/terminal.js +976 -0
  395. package/dist/pipeline/head-tail/tail/predicate-root/production-families/volitional.d.ts +10 -0
  396. package/dist/pipeline/head-tail/tail/predicate-root/production-families/volitional.js +677 -0
  397. package/dist/pipeline/head-tail/tail/predicate-root/production-families.d.ts +1 -8
  398. package/dist/pipeline/head-tail/tail/predicate-root/production-families.js +19 -11025
  399. package/dist/pipeline/head-tail/tail/predicate-root/production-lowering-bindings.js +9 -3
  400. package/dist/pipeline/head-tail/tail/predicate-root/production-registry.d.ts +2 -3
  401. package/dist/pipeline/head-tail/tail/predicate-root/production-registry.js +15 -19
  402. package/dist/pipeline/head-tail/tail/predicate-root/quote-tail-context.d.ts +8 -0
  403. package/dist/pipeline/head-tail/tail/predicate-root/quote-tail-context.js +66 -0
  404. package/dist/pipeline/head-tail/tail/predicate-root/render-derivational-host-projection.d.ts +11 -0
  405. package/dist/pipeline/head-tail/tail/predicate-root/render-derivational-host-projection.js +67 -0
  406. package/dist/pipeline/head-tail/tail/predicate-root/render-root.d.ts +10 -0
  407. package/dist/pipeline/head-tail/tail/predicate-root/render-root.js +203 -0
  408. package/dist/pipeline/head-tail/tail/predicate-root/render-sfp-terminal.d.ts +3 -0
  409. package/dist/pipeline/head-tail/tail/predicate-root/render-sfp-terminal.js +647 -0
  410. package/dist/pipeline/head-tail/tail/predicate-root/render.d.ts +9 -25
  411. package/dist/pipeline/head-tail/tail/predicate-root/render.js +715 -5879
  412. package/dist/pipeline/head-tail/tail/predicate-root/renderers/aspect-bases.d.ts +23 -0
  413. package/dist/pipeline/head-tail/tail/predicate-root/renderers/aspect-bases.js +523 -0
  414. package/dist/pipeline/head-tail/tail/predicate-root/renderers/aspect-benefactive.js +1 -1
  415. package/dist/pipeline/head-tail/tail/predicate-root/renderers/attributive-tail-forms.d.ts +71 -0
  416. package/dist/pipeline/head-tail/tail/predicate-root/renderers/attributive-tail-forms.js +907 -0
  417. package/dist/pipeline/head-tail/tail/predicate-root/renderers/aux-layer-context.d.ts +48 -0
  418. package/dist/pipeline/head-tail/tail/predicate-root/renderers/aux-layer-context.js +1 -0
  419. package/dist/pipeline/head-tail/tail/predicate-root/renderers/base-model.d.ts +3 -1
  420. package/dist/pipeline/head-tail/tail/predicate-root/renderers/base-model.js +35 -1
  421. package/dist/pipeline/head-tail/tail/predicate-root/renderers/base-support.d.ts +8 -1
  422. package/dist/pipeline/head-tail/tail/predicate-root/renderers/base-support.js +90 -0
  423. package/dist/pipeline/head-tail/tail/predicate-root/renderers/command-render.d.ts +1 -13
  424. package/dist/pipeline/head-tail/tail/predicate-root/renderers/command-render.js +3 -10
  425. package/dist/pipeline/head-tail/tail/predicate-root/renderers/command-tail.d.ts +17 -0
  426. package/dist/pipeline/head-tail/tail/predicate-root/renderers/command-tail.js +439 -0
  427. package/dist/pipeline/head-tail/tail/predicate-root/renderers/conjecture-compose.d.ts +34 -0
  428. package/dist/pipeline/head-tail/tail/predicate-root/renderers/conjecture-compose.js +358 -0
  429. package/dist/pipeline/head-tail/tail/predicate-root/renderers/connective-compose.d.ts +2 -120
  430. package/dist/pipeline/head-tail/tail/predicate-root/renderers/connective-compose.js +90 -1670
  431. package/dist/pipeline/head-tail/tail/predicate-root/renderers/connective-ending.d.ts +7 -0
  432. package/dist/pipeline/head-tail/tail/predicate-root/renderers/connective-ending.js +36 -0
  433. package/dist/pipeline/head-tail/tail/predicate-root/renderers/continuative-copula.d.ts +7 -0
  434. package/dist/pipeline/head-tail/tail/predicate-root/renderers/continuative-copula.js +61 -0
  435. package/dist/pipeline/head-tail/tail/predicate-root/renderers/desire-bases.d.ts +9 -0
  436. package/dist/pipeline/head-tail/tail/predicate-root/renderers/desire-bases.js +69 -0
  437. package/dist/pipeline/head-tail/tail/predicate-root/renderers/hostless-conditional-quote.d.ts +12 -2
  438. package/dist/pipeline/head-tail/tail/predicate-root/renderers/hostless-conditional-quote.js +19 -1
  439. package/dist/pipeline/head-tail/tail/predicate-root/renderers/idiom-bases.d.ts +119 -0
  440. package/dist/pipeline/head-tail/tail/predicate-root/renderers/idiom-bases.js +393 -0
  441. package/dist/pipeline/head-tail/tail/predicate-root/renderers/modal-bases.d.ts +77 -0
  442. package/dist/pipeline/head-tail/tail/predicate-root/renderers/modal-bases.js +1243 -0
  443. package/dist/pipeline/head-tail/tail/predicate-root/renderers/non-chain-tail.d.ts +3 -0
  444. package/dist/pipeline/head-tail/tail/predicate-root/renderers/non-chain-tail.js +1045 -0
  445. package/dist/pipeline/head-tail/tail/predicate-root/renderers/noun-copula-attributive-forms.d.ts +38 -0
  446. package/dist/pipeline/head-tail/tail/predicate-root/renderers/noun-copula-attributive-forms.js +507 -0
  447. package/dist/pipeline/head-tail/tail/predicate-root/renderers/noun-copula-conjecture-compose.d.ts +5 -0
  448. package/dist/pipeline/head-tail/tail/predicate-root/renderers/noun-copula-conjecture-compose.js +108 -0
  449. package/dist/pipeline/head-tail/tail/predicate-root/renderers/noun-copula-tail-forms.d.ts +72 -0
  450. package/dist/pipeline/head-tail/tail/predicate-root/renderers/noun-copula-tail-forms.js +1343 -0
  451. package/dist/pipeline/head-tail/tail/predicate-root/renderers/noun-copula.js +9 -3
  452. package/dist/pipeline/head-tail/tail/predicate-root/renderers/op-chain.js +1229 -1107
  453. package/dist/pipeline/head-tail/tail/predicate-root/renderers/operator-chain-tail.d.ts +23 -0
  454. package/dist/pipeline/head-tail/tail/predicate-root/renderers/operator-chain-tail.js +443 -0
  455. package/dist/pipeline/head-tail/tail/predicate-root/renderers/postverb-auxiliary-bases.d.ts +12 -0
  456. package/dist/pipeline/head-tail/tail/predicate-root/renderers/postverb-auxiliary-bases.js +1193 -0
  457. package/dist/pipeline/head-tail/tail/predicate-root/renderers/predicate-base-projection.d.ts +18 -0
  458. package/dist/pipeline/head-tail/tail/predicate-root/renderers/predicate-base-projection.js +284 -0
  459. package/dist/pipeline/head-tail/tail/predicate-root/renderers/predicate-bases.d.ts +3 -271
  460. package/dist/pipeline/head-tail/tail/predicate-root/renderers/predicate-bases.js +438 -5062
  461. package/dist/pipeline/head-tail/tail/predicate-root/renderers/predicate-terminal-compose.d.ts +10 -0
  462. package/dist/pipeline/head-tail/tail/predicate-root/renderers/predicate-terminal-compose.js +167 -0
  463. package/dist/pipeline/head-tail/tail/predicate-root/renderers/purpose-manner-compose.d.ts +9 -0
  464. package/dist/pipeline/head-tail/tail/predicate-root/renderers/purpose-manner-compose.js +92 -0
  465. package/dist/pipeline/head-tail/tail/predicate-root/renderers/quote-complement-compose.d.ts +53 -0
  466. package/dist/pipeline/head-tail/tail/predicate-root/renderers/quote-complement-compose.js +534 -0
  467. package/dist/pipeline/head-tail/tail/predicate-root/renderers/reason-quote-carrier.js +1 -1
  468. package/dist/pipeline/head-tail/tail/predicate-root/renderers/scope-bridge-bases.d.ts +5 -0
  469. package/dist/pipeline/head-tail/tail/predicate-root/renderers/scope-bridge-bases.js +571 -0
  470. package/dist/pipeline/head-tail/tail/predicate-root/renderers/sequence-after-copula.js +1 -1
  471. package/dist/pipeline/head-tail/tail/predicate-root/renderers/sfp-question.d.ts +2 -1
  472. package/dist/pipeline/head-tail/tail/predicate-root/renderers/sfp-question.js +9 -12
  473. package/dist/pipeline/head-tail/tail/predicate-root/renderers/tail-host-trace.d.ts +15 -0
  474. package/dist/pipeline/head-tail/tail/predicate-root/renderers/tail-host-trace.js +134 -0
  475. package/dist/pipeline/head-tail/tail/predicate-root/renderers/voice-benefactive-bases.d.ts +41 -0
  476. package/dist/pipeline/head-tail/tail/predicate-root/renderers/voice-benefactive-bases.js +648 -0
  477. package/dist/pipeline/head-tail/tail/predicate-root/renderers/voice-benefactive-tail.d.ts +12 -0
  478. package/dist/pipeline/head-tail/tail/predicate-root/renderers/voice-benefactive-tail.js +306 -0
  479. package/dist/pipeline/head-tail/tail/predicate-root/span-provenance.d.ts +1 -1
  480. package/dist/pipeline/head-tail/tail/predicate-root/suffix-handoff.d.ts +0 -1
  481. package/dist/pipeline/head-tail/tail/predicate-root/suffix-handoff.js +0 -13
  482. package/dist/pipeline/head-tail/tail/predicate-root/tail-evidence-decision.d.ts +1 -1
  483. package/dist/pipeline/head-tail/tail/predicate-root/tail-evidence-decision.js +5 -45
  484. package/dist/pipeline/head-tail/tail/predicate-root/tame-reason-evidence.d.ts +8 -1
  485. package/dist/pipeline/head-tail/tail/predicate-root/tame-reason-evidence.js +15 -0
  486. package/dist/pipeline/head-tail/tail/predicate-root/trace.d.ts +1 -1
  487. package/dist/pipeline/head-tail/tail/predicate-root/trace.js +2 -1
  488. package/dist/pipeline/head-tail/tail/segments/nominal-frame.d.ts +1 -1
  489. package/dist/pipeline/head-tail/tail/te-tail-continuation-table.js +1 -3
  490. package/dist/pipeline/index.d.ts +0 -4
  491. package/dist/pipeline/lexical-nominal-head-claims.d.ts +1 -1
  492. package/dist/pipeline/lexical-particle-boundary-claims.d.ts +1 -1
  493. package/dist/pipeline/lexical-renyou-head-claims.d.ts +1 -1
  494. package/dist/pipeline/lexical-renyou-head-claims.js +1 -1
  495. package/dist/pipeline/lookup-tables.d.ts +1 -0
  496. package/dist/pipeline/lookup-tables.js +1 -0
  497. package/dist/pipeline/matchers.d.ts +0 -3
  498. package/dist/pipeline/matchers.js +1 -8
  499. package/dist/pipeline/particle-head-dispatch.d.ts +1 -1
  500. package/dist/pipeline/particle-head-dispatch.js +472 -442
  501. package/dist/pipeline/particles/index.d.ts +3 -3
  502. package/dist/pipeline/particles/secondary-particle.d.ts +1 -0
  503. package/dist/pipeline/particles/secondary-particle.js +4 -0
  504. package/dist/pipeline/pattern-runtime.d.ts +0 -61
  505. package/dist/pipeline/pattern-runtime.js +3 -684
  506. package/dist/pipeline/preprocess/analyzer-input-offsets.d.ts +5 -0
  507. package/dist/pipeline/preprocess/analyzer-input-offsets.js +23 -0
  508. package/dist/pipeline/preprocess/auxiliary-variant-retag.d.ts +7 -0
  509. package/dist/pipeline/preprocess/auxiliary-variant-retag.js +178 -0
  510. package/dist/pipeline/preprocess/bungo-nasal-n-retag.d.ts +9 -0
  511. package/dist/pipeline/preprocess/bungo-nasal-n-retag.js +318 -0
  512. package/dist/pipeline/preprocess/cat-meow.d.ts +4 -0
  513. package/dist/pipeline/preprocess/cat-meow.js +46 -0
  514. package/dist/pipeline/preprocess/causative-aux-lemma.d.ts +2 -0
  515. package/dist/pipeline/preprocess/causative-aux-lemma.js +10 -0
  516. package/dist/pipeline/preprocess/collapsed-aspect-aux.d.ts +3 -0
  517. package/dist/pipeline/preprocess/collapsed-aspect-aux.js +217 -0
  518. package/dist/pipeline/preprocess/collapsed-te-oku.d.ts +3 -0
  519. package/dist/pipeline/preprocess/collapsed-te-oku.js +210 -0
  520. package/dist/pipeline/preprocess/collocation-emission.d.ts +14 -0
  521. package/dist/pipeline/preprocess/collocation-emission.js +148 -0
  522. package/dist/pipeline/preprocess/colloquial-vowel-fusion.d.ts +4 -0
  523. package/dist/pipeline/preprocess/colloquial-vowel-fusion.js +164 -0
  524. package/dist/{transform → pipeline/preprocess}/compound-particle-merge.d.ts +2 -2
  525. package/dist/{transform → pipeline/preprocess}/compound-particle-merge.js +5 -5
  526. package/dist/pipeline/preprocess/copula-focus-negative-state-change.d.ts +3 -0
  527. package/dist/pipeline/preprocess/copula-focus-negative-state-change.js +79 -0
  528. package/dist/pipeline/preprocess/copula-renyou-retag.d.ts +3 -0
  529. package/dist/pipeline/preprocess/copula-renyou-retag.js +56 -0
  530. package/dist/pipeline/preprocess/emphasis-sokuon.d.ts +10 -0
  531. package/dist/pipeline/preprocess/emphasis-sokuon.js +182 -0
  532. package/dist/{transform → pipeline/preprocess}/explanatory-mon-sfp-retag.d.ts +1 -1
  533. package/dist/{transform → pipeline/preprocess}/explanatory-mon-sfp-retag.js +2 -2
  534. package/dist/pipeline/preprocess/follower-context.d.ts +7 -0
  535. package/dist/pipeline/preprocess/follower-context.js +33 -0
  536. package/dist/pipeline/preprocess/fused-conditional.d.ts +3 -0
  537. package/dist/pipeline/preprocess/fused-conditional.js +97 -0
  538. package/dist/pipeline/preprocess/imperative-mistag-recovery.d.ts +7 -0
  539. package/dist/pipeline/preprocess/imperative-mistag-recovery.js +135 -0
  540. package/dist/pipeline/preprocess/input-text-normalization.d.ts +3 -0
  541. package/dist/pipeline/preprocess/input-text-normalization.js +39 -0
  542. package/dist/pipeline/preprocess/kansai-dialect.d.ts +9 -0
  543. package/dist/pipeline/preprocess/kansai-dialect.js +501 -0
  544. package/dist/{transform → pipeline/preprocess}/keijouji-copula-de-retag.d.ts +1 -1
  545. package/dist/{transform → pipeline/preprocess}/keijouji-copula-de-retag.js +2 -2
  546. package/dist/{transform → pipeline/preprocess}/ni-complement-matrix-flip.d.ts +1 -1
  547. package/dist/{transform → pipeline/preprocess}/ni-complement-matrix-flip.js +2 -2
  548. package/dist/pipeline/preprocess/past-quotative-tte-resplit.d.ts +3 -0
  549. package/dist/pipeline/preprocess/past-quotative-tte-resplit.js +55 -0
  550. package/dist/pipeline/preprocess/prolonged-orthography.d.ts +5 -0
  551. package/dist/pipeline/preprocess/prolonged-orthography.js +79 -0
  552. package/dist/pipeline/preprocess/prolonged-surface-canonicalization.d.ts +5 -0
  553. package/dist/pipeline/preprocess/prolonged-surface-canonicalization.js +161 -0
  554. package/dist/pipeline/preprocess/punctuation-canonicalization.d.ts +5 -0
  555. package/dist/pipeline/preprocess/punctuation-canonicalization.js +160 -0
  556. package/dist/{transform → pipeline/preprocess}/quotative-manner-noun-flip.d.ts +2 -2
  557. package/dist/{transform → pipeline/preprocess}/quotative-manner-noun-flip.js +10 -10
  558. package/dist/{transform → pipeline/preprocess}/reduplicated-mimetic.d.ts +1 -1
  559. package/dist/{transform → pipeline/preprocess}/reduplicated-mimetic.js +3 -3
  560. package/dist/{transform → pipeline/preprocess}/rentaishi-no-nominalizer-retag.d.ts +1 -1
  561. package/dist/{transform → pipeline/preprocess}/rentaishi-no-nominalizer-retag.js +2 -2
  562. package/dist/pipeline/preprocess/runtime-token-from-analyzer.d.ts +5 -0
  563. package/dist/pipeline/preprocess/runtime-token-from-analyzer.js +77 -0
  564. package/dist/pipeline/preprocess/runtime-token-from-preprocess.d.ts +13 -0
  565. package/dist/pipeline/preprocess/runtime-token-from-preprocess.js +15 -0
  566. package/dist/pipeline/preprocess/standalone-voice-mark.d.ts +9 -0
  567. package/dist/pipeline/preprocess/standalone-voice-mark.js +73 -0
  568. package/dist/pipeline/preprocess/synthetic-token.d.ts +10 -0
  569. package/dist/pipeline/preprocess/synthetic-token.js +26 -0
  570. package/dist/pipeline/preprocess/te-contraction.d.ts +4 -0
  571. package/dist/pipeline/preprocess/te-contraction.js +150 -0
  572. package/dist/pipeline/preprocess/terminal-role-tail.d.ts +5 -0
  573. package/dist/pipeline/preprocess/terminal-role-tail.js +148 -0
  574. package/dist/{transform → pipeline/preprocess}/terminal-sfp-retag-closure.d.ts +2 -2
  575. package/dist/{transform → pipeline/preprocess}/terminal-sfp-retag-closure.js +4 -4
  576. package/dist/pipeline/preprocess/to-iu-contraction.d.ts +2 -0
  577. package/dist/pipeline/preprocess/to-iu-contraction.js +65 -0
  578. package/dist/{transform → pipeline/preprocess}/volitional-resolution-sfp-retag.d.ts +1 -1
  579. package/dist/{transform → pipeline/preprocess}/volitional-resolution-sfp-retag.js +2 -2
  580. package/dist/{transform → pipeline/preprocess}/youon-remerge.d.ts +1 -1
  581. package/dist/{transform → pipeline/preprocess}/youon-remerge.js +3 -3
  582. package/dist/pipeline/projection/narou-ruby-input.d.ts +17 -0
  583. package/dist/pipeline/projection/narou-ruby-input.js +149 -0
  584. package/dist/pipeline/projection/parenthetical-delimiter-annotation.d.ts +6 -0
  585. package/dist/pipeline/projection/parenthetical-delimiter-annotation.js +117 -0
  586. package/dist/pipeline/projection/parenthetical-ruby-absorption.d.ts +6 -0
  587. package/dist/pipeline/projection/parenthetical-ruby-absorption.js +198 -0
  588. package/dist/pipeline/projection/parenthetical-source-boundary.d.ts +12 -0
  589. package/dist/pipeline/projection/parenthetical-source-boundary.js +117 -0
  590. package/dist/pipeline/projection/parenthetical-source-identity.d.ts +14 -0
  591. package/dist/pipeline/projection/parenthetical-source-identity.js +443 -0
  592. package/dist/pipeline/projection/parenthetical-target-insertion.d.ts +22 -0
  593. package/dist/pipeline/projection/parenthetical-target-insertion.js +584 -0
  594. package/dist/pipeline/projection/prepared-translation.d.ts +52 -0
  595. package/dist/pipeline/projection/prepared-translation.js +1 -0
  596. package/dist/pipeline/projection/prepared-tree.d.ts +6 -0
  597. package/dist/pipeline/projection/prepared-tree.js +66 -0
  598. package/dist/pipeline/projection/raw-parenthetical-split.d.ts +15 -0
  599. package/dist/pipeline/projection/raw-parenthetical-split.js +78 -0
  600. package/dist/pipeline/projection/ruby-annotation.d.ts +5 -0
  601. package/dist/pipeline/projection/ruby-annotation.js +161 -0
  602. package/dist/pipeline/projection/text-offset-projection.d.ts +7 -0
  603. package/dist/pipeline/projection/text-offset-projection.js +111 -0
  604. package/dist/pipeline/projection/transparent-pause-island.d.ts +8 -0
  605. package/dist/pipeline/projection/transparent-pause-island.js +188 -0
  606. package/dist/pipeline/pronominal-no-dispatch.js +1 -1
  607. package/dist/pipeline/quote/host-runtime.js +3 -2
  608. package/dist/pipeline/quote/host-taxonomy.d.ts +1 -0
  609. package/dist/pipeline/quote/host-taxonomy.js +2 -2
  610. package/dist/pipeline/quote/question-taking-enumeration.d.ts +1 -1
  611. package/dist/pipeline/quote/question-taking-enumeration.js +0 -4
  612. package/dist/pipeline/reason-source-evidence.d.ts +1 -0
  613. package/dist/pipeline/reason-source-evidence.js +1 -1
  614. package/dist/pipeline/rendering/functional-chain.d.ts +2 -0
  615. package/dist/pipeline/rendering/functional-chain.js +14 -0
  616. package/dist/pipeline/rendering/nominal-head-tail-plan-trace.d.ts +10 -0
  617. package/dist/pipeline/rendering/nominal-head-tail-plan-trace.js +336 -0
  618. package/dist/pipeline/rendering/render-plan-inspect.d.ts +9 -0
  619. package/dist/pipeline/rendering/render-plan-inspect.js +121 -0
  620. package/dist/pipeline/rendering/render-plan-payloads.d.ts +28 -0
  621. package/dist/pipeline/rendering/render-plan-payloads.js +125 -0
  622. package/dist/pipeline/rendering/render-plan-rewrite.d.ts +32 -0
  623. package/dist/pipeline/rendering/render-plan-rewrite.js +540 -0
  624. package/dist/pipeline/rendering/render-plan-segments.d.ts +42 -0
  625. package/dist/pipeline/rendering/render-plan-segments.js +263 -0
  626. package/dist/pipeline/rendering/render-plan.d.ts +4 -57
  627. package/dist/pipeline/rendering/render-plan.js +52 -1433
  628. package/dist/pipeline/rendering/request-normalization.d.ts +0 -1
  629. package/dist/pipeline/rendering/request-normalization.js +0 -3
  630. package/dist/pipeline/rendering/segment-allomorph.d.ts +17 -0
  631. package/dist/pipeline/rendering/segment-allomorph.js +152 -0
  632. package/dist/pipeline/rendering/segment-annotation-keys.d.ts +6 -0
  633. package/dist/pipeline/rendering/segment-annotation-keys.js +137 -0
  634. package/dist/pipeline/rendering/stem-derivation.js +1 -1
  635. package/dist/pipeline/rendering/target-segment-build.d.ts +13 -0
  636. package/dist/pipeline/rendering/target-segment-build.js +167 -0
  637. package/dist/pipeline/rendering/terminal-unit-punctuation.d.ts +16 -0
  638. package/dist/pipeline/rendering/terminal-unit-punctuation.js +96 -0
  639. package/dist/pipeline/rendering/unit-surface.d.ts +9 -0
  640. package/dist/pipeline/rendering/unit-surface.js +35 -0
  641. package/dist/pipeline/resource-cache.d.ts +19 -0
  642. package/dist/pipeline/resource-cache.js +164 -0
  643. package/dist/pipeline/rules/common.d.ts +0 -1
  644. package/dist/pipeline/rules/common.js +0 -1
  645. package/dist/pipeline/rules/entry-aux.d.ts +0 -2
  646. package/dist/pipeline/rules/entry-aux.js +0 -4
  647. package/dist/pipeline/rules/postaux-unsupported.js +1 -5
  648. package/dist/pipeline/rules/pre-entry.d.ts +0 -1
  649. package/dist/pipeline/rules/pre-entry.js +0 -1
  650. package/dist/pipeline/rules/tail-finalization.js +4 -5
  651. package/dist/pipeline/semantics/conditional.d.ts +2 -1
  652. package/dist/pipeline/semantics/conditional.js +3 -2
  653. package/dist/pipeline/semantics/copula-tail-runtime.js +2 -2
  654. package/dist/pipeline/semantics/explanatory-mon-reading.d.ts +1 -1
  655. package/dist/pipeline/semantics/explanatory-mon-reading.js +2 -2
  656. package/dist/pipeline/semantics/extent-phrase.js +1 -1
  657. package/dist/pipeline/semantics/frame.d.ts +3 -3
  658. package/dist/pipeline/semantics/frame.js +4 -4
  659. package/dist/pipeline/semantics/gano-conversion.d.ts +1 -2
  660. package/dist/pipeline/semantics/gano-conversion.js +1 -9
  661. package/dist/pipeline/semantics/grammar-runtime.d.ts +0 -7
  662. package/dist/pipeline/semantics/grammar-runtime.js +0 -92
  663. package/dist/pipeline/semantics/honorific.d.ts +1 -2
  664. package/dist/pipeline/semantics/honorific.js +0 -3
  665. package/dist/pipeline/semantics/mono-modal.d.ts +1 -1
  666. package/dist/pipeline/semantics/numeric.js +1 -3
  667. package/dist/pipeline/semantics/sfp-surface.js +8 -0
  668. package/dist/pipeline/source-candidate-set.d.ts +1 -2
  669. package/dist/pipeline/source-candidate-set.js +0 -3
  670. package/dist/pipeline/source-coordinate.d.ts +20 -0
  671. package/dist/pipeline/source-coordinate.js +42 -0
  672. package/dist/pipeline/structural-relation/clause-connective-relations.d.ts +12 -0
  673. package/dist/pipeline/structural-relation/clause-connective-relations.js +327 -0
  674. package/dist/pipeline/structural-relation/collect.d.ts +1 -12
  675. package/dist/pipeline/structural-relation/collect.js +11 -3105
  676. package/dist/pipeline/structural-relation/connective-relation-match.d.ts +17 -0
  677. package/dist/pipeline/structural-relation/connective-relation-match.js +39 -0
  678. package/dist/pipeline/structural-relation/diagnostics.d.ts +0 -2
  679. package/dist/pipeline/structural-relation/diagnostics.js +0 -7
  680. package/dist/pipeline/structural-relation/ka-parallel-relations.d.ts +3 -0
  681. package/dist/pipeline/structural-relation/ka-parallel-relations.js +695 -0
  682. package/dist/pipeline/structural-relation/nari-relations.d.ts +3 -0
  683. package/dist/pipeline/structural-relation/nari-relations.js +367 -0
  684. package/dist/pipeline/structural-relation/parallel-item-evidence.d.ts +12 -0
  685. package/dist/pipeline/structural-relation/parallel-item-evidence.js +73 -0
  686. package/dist/pipeline/structural-relation/punctuated-attributive-relations.d.ts +2 -0
  687. package/dist/pipeline/structural-relation/punctuated-attributive-relations.js +224 -0
  688. package/dist/pipeline/structural-relation/purpose-relations.d.ts +7 -0
  689. package/dist/pipeline/structural-relation/purpose-relations.js +306 -0
  690. package/dist/pipeline/structural-relation/quote-clause-boundary.d.ts +47 -0
  691. package/dist/pipeline/structural-relation/quote-clause-boundary.js +216 -0
  692. package/dist/pipeline/structural-relation/quote-closed-toka.d.ts +22 -0
  693. package/dist/pipeline/structural-relation/quote-closed-toka.js +158 -0
  694. package/dist/pipeline/structural-relation/quote-content-endings.d.ts +20 -0
  695. package/dist/pipeline/structural-relation/quote-content-endings.js +163 -0
  696. package/dist/pipeline/structural-relation/quote-content-span.d.ts +23 -0
  697. package/dist/pipeline/structural-relation/quote-content-span.js +270 -0
  698. package/dist/pipeline/structural-relation/quote-nominal-and-passive.d.ts +22 -0
  699. package/dist/pipeline/structural-relation/quote-nominal-and-passive.js +724 -0
  700. package/dist/pipeline/structural-relation/quote-payload.d.ts +33 -0
  701. package/dist/pipeline/structural-relation/quote-payload.js +137 -0
  702. package/dist/pipeline/structural-relation/quote-question-content.d.ts +18 -0
  703. package/dist/pipeline/structural-relation/quote-question-content.js +588 -0
  704. package/dist/pipeline/structural-relation/quote-reason-copula.d.ts +18 -0
  705. package/dist/pipeline/structural-relation/quote-reason-copula.js +84 -0
  706. package/dist/pipeline/structural-relation/quote-relation-enrichment.d.ts +4 -0
  707. package/dist/pipeline/structural-relation/quote-relation-enrichment.js +174 -0
  708. package/dist/pipeline/structural-relation/quote-request.d.ts +16 -0
  709. package/dist/pipeline/structural-relation/quote-request.js +249 -0
  710. package/dist/pipeline/structural-relation/quote.d.ts +4 -130
  711. package/dist/pipeline/structural-relation/quote.js +105 -2627
  712. package/dist/pipeline/structural-relation/reason-relations.d.ts +6 -0
  713. package/dist/pipeline/structural-relation/reason-relations.js +328 -0
  714. package/dist/pipeline/structural-relation/relation-coordinates.d.ts +21 -0
  715. package/dist/pipeline/structural-relation/relation-coordinates.js +110 -0
  716. package/dist/pipeline/structural-relation/render-attributive.d.ts +25 -0
  717. package/dist/pipeline/structural-relation/render-attributive.js +195 -0
  718. package/dist/pipeline/structural-relation/render-clause-connective.d.ts +29 -0
  719. package/dist/pipeline/structural-relation/render-clause-connective.js +114 -0
  720. package/dist/pipeline/structural-relation/render-connective-plan.d.ts +28 -0
  721. package/dist/pipeline/structural-relation/render-connective-plan.js +164 -0
  722. package/dist/pipeline/structural-relation/render-parallel.d.ts +60 -0
  723. package/dist/pipeline/structural-relation/render-parallel.js +1088 -0
  724. package/dist/pipeline/structural-relation/render-quote.d.ts +75 -0
  725. package/dist/pipeline/structural-relation/render-quote.js +968 -0
  726. package/dist/pipeline/structural-relation/render-reason-copula.d.ts +24 -0
  727. package/dist/pipeline/structural-relation/render-reason-copula.js +324 -0
  728. package/dist/pipeline/structural-relation/render-source-sequence.d.ts +11 -0
  729. package/dist/pipeline/structural-relation/render-source-sequence.js +154 -0
  730. package/dist/pipeline/structural-relation/render-unit-spans.d.ts +35 -0
  731. package/dist/pipeline/structural-relation/render-unit-spans.js +71 -0
  732. package/dist/pipeline/structural-relation/render.d.ts +2 -25
  733. package/dist/pipeline/structural-relation/render.js +10 -3043
  734. package/dist/pipeline/structural-relation/source-predicate-operator.d.ts +2 -1
  735. package/dist/pipeline/structural-relation/tari-listing-relations.d.ts +5 -0
  736. package/dist/pipeline/structural-relation/tari-listing-relations.js +354 -0
  737. package/dist/pipeline/structural-relation/toka-nominal-listing-relations.d.ts +2 -0
  738. package/dist/pipeline/structural-relation/toka-nominal-listing-relations.js +154 -0
  739. package/dist/pipeline/structural-relation/toka-nominal-listing-run.d.ts +11 -1
  740. package/dist/pipeline/structural-relation/toka-nominal-listing-run.js +16 -4
  741. package/dist/pipeline/structural-relation/types.d.ts +10 -1
  742. package/dist/pipeline/translation/access.d.ts +0 -3
  743. package/dist/pipeline/translation/unit.d.ts +4 -1
  744. package/dist/pipeline/translation/unit.js +29 -9
  745. package/dist/pipeline/translation/warnings.d.ts +9 -0
  746. package/dist/pipeline/translation/warnings.js +251 -0
  747. package/dist/pipeline-factory.js +2 -1
  748. package/dist/scripts/diagnose.js +3 -2
  749. package/dist/types/pos.d.ts +3 -0
  750. package/dist/types/pos.js +8 -0
  751. package/dist/types/reanalysis.d.ts +0 -1
  752. package/dist/types/reanalysis.js +0 -1
  753. package/dist/types/render-plan.d.ts +1 -2
  754. package/dist/utils/char-class.d.ts +2 -0
  755. package/dist/utils/char-class.js +6 -0
  756. package/dist/utils/record.d.ts +1 -0
  757. package/dist/utils/record.js +3 -0
  758. package/dist/webext-provider.d.ts +7 -0
  759. package/dist/webext-provider.js +56 -16
  760. package/package.json +1 -1
  761. package/dist/pipeline/head-tail/audit/types.d.ts +0 -7
  762. /package/dist/pipeline/head-tail/{audit/types.js → tail/predicate-root/integration/contracts.js} +0 -0
@@ -6,15 +6,23 @@ import {} from "../../../../../types/warning.js";
6
6
  import {} from "../../../../lookup-tables.js";
7
7
  import {} from "../grammar.js";
8
8
  import { isChainableAspectOpKind, isChainableHeadOp, isHeadOp, isOperatorWrapBoundaryHeadOp, isSimpleAspectOpKind, multiAspectPathCanUseOperatorFold, operatorCreatesPotentialPredicate, operatorCreatesSourceVerbalPredicate, sourceVerbalPredicateAfterAuxOp } from "../operator-head.js";
9
- import { isRequestCommandBaseOp } from "../inspect.js";
9
+ import { isRequestCommandBaseOp, isBenefactiveAspectKind } from "../inspect.js";
10
10
  import { applyNegationChainToLemmaBase, hostProjectionSourceTrace, policyWithPrependedHostPrefix, projectedHostTraceSegment, scopeTopicTraceCarrierContraction, stemFusionSourceTrace, tracePrefixContractionForTarget, predicateBasePolicyAllomorphHost } from "./base-model.js";
11
11
  export { scopeTopicTraceCarrierContraction };
12
12
  export { isChainableHeadOp, isHeadOp, isOperatorWrapBoundaryHeadOp, isSimpleAspectOpKind, multiAspectPathCanUseOperatorFold };
13
- import { applyNonLastPrefixContractions, finalNegationLoweringForcesPast, lowerFinalNegationForCommittedBase, nounSubjectPart, obligationBase, prohibitionPredicateBase, scopeCarrierCopulaBase, simpleStemBaseResult } from "./base-support.js";
14
- import { conjectureBase, nounCopulaObligationBase } from "./connective-compose.js";
13
+ import { applyNonLastPrefixContractions, finalNegationLoweringForcesPast, lowerFinalNegationForCommittedBase, nounSubjectPart, obligationBase, prohibitionPredicateBase, scopeCarrierCopulaBase, simpleStemBaseResult, copulaCarrierBaseForInterOp, stateChangeBase } from "./base-support.js";
14
+ import { conjectureBase } from "./conjecture-compose.js";
15
+ import { nounCopulaObligationBase } from "./connective-compose.js";
15
16
  import { pastNegStemAttributive } from "./final-forms.js";
16
17
  import { stemAllowsSahenShortNegationSplit } from "../short-negation-policy.js";
17
- import { aspectBaseResult, benefactiveBaseFromInput, benefactiveDesiderativeRequestBase, cannotRefrainNegativeDewaIrarenaiBase, completionTeIruNegativeAspectForComposedInput, copulaCarrierBaseForInterOp, copulaCarrierConjectureBase, decisionKotoNiSuruBase, degreeIntensifierBase, desiderativeBaseFromPredicateBase, desireBaseResult, experienceBase, forbiddenBase, inevitableZaruOEnaiBase, isBenefactiveAspectKind, limitNegationBaseFromPredicateBase, madeMoNaiBase, maiScopeCarrierBase, monoHostPredicateBase, methodYouGaNaiBase, miseruBase, modalBase, modalFinalChainPolicy, negativeNecessityKotoWaBase, negativeNecessitySumuBase, negativeTeAdverbialAspectBaseResult, nominalHostEvidentialLikenessBase, nodaCarrierAbsorbedByHostBoundNoun, nodaCarrierConjectureBase, nodaCarrierLikenessBase, nodaCarrierKamoBase, normalizeSimpleAspectForComposedInput, onlyOptionBase, outcomeKotoNiNaruBase, permissionBase, postverbAuxiliaryBaseResult, potentialBase, potentialDirectionalAspectBaseResult, potentialObjectBaseFromAttributive, predicateProjectionCarrierBase, predicateQuoteCarrierBase, predicateSuffixBaseResult, quotedPropositionLikenessBase, scopeBridgeBase, simpleAspectWithDropAuxSemantic, simpleAspectWithoutSemantic, soudaHearsayBaseFromPredicateBase, sourceVerbAdjectivalDirectionalAspectBaseResult, sourceVerbAdjectivalEllipticTeIruNegativeBaseResult, sourceVerbAdjectivalTeShimauBaseResult, sourceVerbAdjectivalTsutsuAruBaseResult, stateChangeBase, sufficiencyConditionalBase, teEvaluationBase, teHoshiiSourceTrace, teIruAuxiliaryNegationFocusParticle, tokoroBaseFromPredicateBase, voiceBase, wakeCarrierConjectureBase, wakeExplanatoryCitationBase, wakeImpossibleBase } from "./predicate-bases.js";
18
+ import { aspectBaseResult, completionTeIruNegativeAspectForComposedInput, miseruBase, negativeTeAdverbialAspectBaseResult, normalizeSimpleAspectForComposedInput, potentialDirectionalAspectBaseResult, simpleAspectWithDropAuxSemantic, simpleAspectWithoutSemantic, sourceVerbAdjectivalDirectionalAspectBaseResult, sourceVerbAdjectivalEllipticTeIruNegativeBaseResult, sourceVerbAdjectivalTeShimauBaseResult, sourceVerbAdjectivalTsutsuAruBaseResult, teIruAuxiliaryNegationFocusParticle } from "./aspect-bases.js";
19
+ import { benefactiveBaseFromInput, benefactiveDesiderativeRequestBase, potentialBase, potentialObjectBaseFromAttributive, voiceBase } from "./voice-benefactive-bases.js";
20
+ import { cannotRefrainNegativeDewaIrarenaiBase, decisionKotoNiSuruBase, experienceBase, forbiddenBase, inevitableZaruOEnaiBase, madeMoNaiBase, methodYouGaNaiBase, negativeNecessityKotoWaBase, negativeNecessitySumuBase, onlyOptionBase, outcomeKotoNiNaruBase, permissionBase, sufficiencyConditionalBase, teEvaluationBase } from "./idiom-bases.js";
21
+ import { copulaCarrierConjectureBase, limitNegationBaseFromPredicateBase, maiScopeCarrierBase, monoHostPredicateBase, modalBase, modalFinalChainPolicy, nominalHostEvidentialLikenessBase, nodaCarrierAbsorbedByHostBoundNoun, nodaCarrierConjectureBase, nodaCarrierLikenessBase, nodaCarrierKamoBase, quotedPropositionLikenessBase, soudaHearsayBaseFromPredicateBase, tokoroBaseFromPredicateBase, wakeCarrierConjectureBase, wakeExplanatoryCitationBase, wakeImpossibleBase } from "./modal-bases.js";
22
+ import { degreeIntensifierBase, postverbAuxiliaryBaseResult } from "./postverb-auxiliary-bases.js";
23
+ import { desiderativeBaseFromPredicateBase, desireBaseResult, teHoshiiSourceTrace } from "./desire-bases.js";
24
+ import { predicateProjectionCarrierBase, predicateQuoteCarrierBase, predicateSuffixBaseResult } from "./predicate-bases.js";
25
+ import { scopeBridgeBase } from "./scope-bridge-bases.js";
18
26
  export function operatorChainSlotForWrapOp(wrapOp, layer, opChain) {
19
27
  if (wrapOp === null)
20
28
  return null;
@@ -200,66 +208,63 @@ export function chainStemTraceFields(stem) {
200
208
  ...(stem.projectedHost === undefined ? {} : { stemProjectedHost: stem.projectedHost })
201
209
  };
202
210
  }
203
- export function opToBase(op, inputBase, ctx) {
204
- const stemLemma = inputBase.final.lemma;
205
- const stemIrregular = inputBase.final.irregular;
206
- const isVerb = inputBase.final.isVerb;
207
- const opPreNeg = ctx.preModalNeg;
208
- const opPast = ctx.past;
209
- const prependInputPolicy = (base, options = {}) => {
210
- if (inputBase.policy?.kind === "noun_copula_interop") {
211
- return base.policy;
212
- }
213
- const policy = base.policy ?? (options.carryInputPolicy === false ? undefined : inputBase.policy);
214
- if (policy?.kind === "te_iru_negative" && inputBase.prefix.length > 0) {
215
- return {
216
- ...policy,
217
- stemPrefix: `${inputBase.prefix}${policy.stemPrefix ?? ""}`
218
- };
219
- }
220
- if (policy?.kind === "te_iru_attributive_contraction") {
221
- if (inputBase.prefix.length > 0)
222
- return undefined;
223
- if (inputBase.policy !== undefined)
224
- return inputBase.policy;
225
- }
226
- return policy;
227
- };
228
- const prependInputPrefix = (base, options = {}) => {
229
- const policy = prependInputPolicy(base, options);
230
- if (policy === undefined && base.policy?.kind === "te_iru_attributive_contraction") {
231
- return {
232
- prefix: `${inputBase.prefix}${base.prefix}`,
233
- final: base.final,
234
- ...(base.capabilities === undefined ? {} : { capabilities: base.capabilities })
235
- };
236
- }
237
- const shiftedPolicy = policy !== undefined && policy === base.policy
238
- ? policyWithPrependedHostPrefix(policy, inputBase.prefix)
239
- : policy;
211
+ function prependInputPolicy(inputBase, base, options = {}) {
212
+ if (inputBase.policy?.kind === "noun_copula_interop") {
213
+ return base.policy;
214
+ }
215
+ const policy = base.policy ?? (options.carryInputPolicy === false ? undefined : inputBase.policy);
216
+ if (policy?.kind === "te_iru_negative" && inputBase.prefix.length > 0) {
217
+ return {
218
+ ...policy,
219
+ stemPrefix: `${inputBase.prefix}${policy.stemPrefix ?? ""}`
220
+ };
221
+ }
222
+ if (policy?.kind === "te_iru_attributive_contraction") {
223
+ if (inputBase.prefix.length > 0)
224
+ return undefined;
225
+ if (inputBase.policy !== undefined)
226
+ return inputBase.policy;
227
+ }
228
+ return policy;
229
+ }
230
+ function prependInputPrefix(inputBase, base, options = {}) {
231
+ const policy = prependInputPolicy(inputBase, base, options);
232
+ if (policy === undefined && base.policy?.kind === "te_iru_attributive_contraction") {
240
233
  return {
241
- ...base,
242
234
  prefix: `${inputBase.prefix}${base.prefix}`,
243
235
  final: base.final,
244
- ...(shiftedPolicy === undefined ? {} : { policy: shiftedPolicy })
236
+ ...(base.capabilities === undefined ? {} : { capabilities: base.capabilities })
245
237
  };
238
+ }
239
+ const shiftedPolicy = policy !== undefined && policy === base.policy
240
+ ? policyWithPrependedHostPrefix(policy, inputBase.prefix)
241
+ : policy;
242
+ return {
243
+ ...base,
244
+ prefix: `${inputBase.prefix}${base.prefix}`,
245
+ final: base.final,
246
+ ...(shiftedPolicy === undefined ? {} : { policy: shiftedPolicy })
246
247
  };
247
- const withInputPrefix = (res, options = {}) => {
248
- if (!res.ok)
249
- return res;
250
- return {
251
- ...res,
252
- base: prependInputPrefix(res.base, options),
253
- ...(res.connectiveBaseOverride === undefined
254
- ? {}
255
- : {
256
- connectiveBaseOverride: {
257
- ...res.connectiveBaseOverride,
258
- base: prependInputPrefix(res.connectiveBaseOverride.base, options)
259
- }
260
- })
261
- };
248
+ }
249
+ function withInputPrefix(inputBase, res, options = {}) {
250
+ if (!res.ok)
251
+ return res;
252
+ return {
253
+ ...res,
254
+ base: prependInputPrefix(inputBase, res.base, options),
255
+ ...(res.connectiveBaseOverride === undefined
256
+ ? {}
257
+ : {
258
+ connectiveBaseOverride: {
259
+ ...res.connectiveBaseOverride,
260
+ base: prependInputPrefix(inputBase, res.connectiveBaseOverride.base, options)
261
+ }
262
+ })
262
263
  };
264
+ }
265
+ export function opToBase(op, inputBase, ctx) {
266
+ const opPreNeg = ctx.preModalNeg;
267
+ const opPast = ctx.past;
263
268
  switch (op.kind) {
264
269
  case "postverbAuxiliary":
265
270
  return postverbAuxiliaryBaseResult(op, inputBase, ctx);
@@ -283,814 +288,903 @@ export function opToBase(op, inputBase, ctx) {
283
288
  });
284
289
  case "predicateSuffix":
285
290
  return predicateSuffixBaseResult(op, inputBase, ctx);
286
- case "aspect": {
287
- if (!isChainableAspectOpKind(op.aspect)) {
288
- return { ok: false, reason: `aspect kind '${op.aspect}' not chainable — invariant violation` };
289
- }
290
- const simpleAspect = isSimpleAspectOpKind(op.aspect)
291
- ? op
292
- : null;
293
- const simpleAspectForDropAux = simpleAspect !== null &&
294
- simpleAspect.aspect === "te_iru" &&
295
- inputBase.policy?.kind === "accustomed_aspect_projection"
296
- ? simpleAspectWithDropAuxSemantic(simpleAspect)
297
- : simpleAspect;
298
- if (simpleAspect !== null &&
299
- simpleAspect.aspect === "te_iru" &&
300
- simpleAspect.auxiliaryHonorific === "respect" &&
301
- (!isVerb || simpleAspectForDropAux?.semantic?.renderStrategy === "drop_aux") &&
302
- opPreNeg === null &&
303
- !opPast &&
304
- inputBase.final.kind === "lemma") {
305
- return {
306
- ok: true,
307
- base: {
308
- ...inputBase,
309
- final: {
310
- kind: "lemma",
311
- lemma: `${conjugate(inputBase.final.lemma, inputBase.final.irregular, "(으)시")}다`,
312
- irregular: null,
313
- isVerb: inputBase.final.isVerb
314
- }
315
- },
316
- chainOnFinalSupported: true
317
- };
318
- }
319
- if (op.aspect === "te_iru" &&
320
- inputBase.final.lemma === "있다" &&
321
- !inputBase.final.isVerb &&
322
- opPreNeg === null) {
323
- const focusParticle = simpleAspect === null
324
- ? undefined
325
- : teIruAuxiliaryNegationFocusParticle(simpleAspect);
326
- return {
327
- ok: true,
328
- base: inputBase,
329
- chainOnFinalSupported: inputBase.policy?.kind === "benefactive" && inputBase.policy.potential
330
- ? false
331
- : true,
332
- ...(focusParticle === undefined
333
- ? {}
334
- : { finalNegationOptions: { firstNegationFocusParticle: focusParticle } }),
335
- ...(inputBase.policy?.kind === "benefactive" && inputBase.policy.potential
336
- ? { finalNegationLoweringPolicy: "potential_idiom" }
337
- : {})
338
- };
339
- }
340
- if (op.aspect === "te_iru" &&
341
- simpleAspectForDropAux?.semantic?.renderStrategy === "drop_aux") {
342
- const focusParticle = teIruAuxiliaryNegationFocusParticle(simpleAspectForDropAux);
343
- return {
344
- ok: true,
345
- base: inputBase,
346
- chainOnFinalSupported: true,
347
- ...(focusParticle === undefined
348
- ? {}
349
- : { finalNegationOptions: { firstNegationFocusParticle: focusParticle } }),
350
- };
351
- }
352
- if (inputBase.policy?.kind === "accustomed_aspect_projection" &&
353
- isSimpleAspectOpKind(op.aspect)) {
354
- if (opPreNeg !== null)
355
- return { ok: false, reason: "stative postverb neg + aspect 영역 외" };
356
- if (opPast)
357
- return { ok: false, reason: "stative postverb past + aspect 영역 외" };
358
- const changedBase = stateChangeBase(inputBase, "adjectival");
359
- if (!changedBase.final.isVerb) {
360
- return { ok: false, reason: "stative postverb aspect change-base 영역 외" };
361
- }
362
- const aspectResult = aspectBaseResult(simpleAspectWithoutSemantic(op), changedBase.final.lemma, changedBase.final.irregular, ctx.lookups);
363
- if (!aspectResult.ok)
364
- return aspectResult;
365
- const stativePrefix = `${changedBase.prefix}${aspectResult.base.prefix}`;
366
- const stativeTrace = hostProjectionSourceTrace({
367
- hostText: stativePrefix.trimEnd(),
368
- inputPrefix: inputBase.prefix,
369
- basePrefix: stativePrefix,
370
- sourceTokens: op.source.tokens,
371
- splitFinal: "none"
372
- });
373
- const { sourceTrace: _stativeCarried, ...stativeRest } = aspectResult;
374
- void _stativeCarried;
375
- return {
376
- ...stativeRest,
377
- base: {
378
- ...aspectResult.base,
379
- prefix: stativePrefix
380
- },
381
- ...(stativeTrace === undefined ? {} : { sourceTrace: stativeTrace })
382
- };
383
- }
384
- if (opPreNeg === null && !opPast) {
385
- const potentialDirection = potentialDirectionalAspectBaseResult(op, inputBase);
386
- if (potentialDirection !== null) {
387
- return potentialDirection;
388
- }
389
- }
390
- if (op.aspect === "te_shimau" &&
391
- simpleAspect !== null &&
392
- ctx.sourceStemIsVerb === true &&
393
- !ctx.hasPriorChainOp &&
394
- !isVerb &&
395
- opPreNeg === null &&
396
- !opPast) {
397
- const bridged = sourceVerbAdjectivalTeShimauBaseResult(simpleAspect, inputBase);
398
- if (bridged !== null)
399
- return bridged;
400
- }
401
- if (op.aspect === "te_iru" &&
402
- ctx.sourceStemIsSahenPredicate === true &&
403
- !isVerb &&
404
- opPreNeg === null &&
405
- !opPast) {
406
- return {
407
- ok: true,
408
- base: inputBase,
409
- chainOnFinalSupported: true
410
- };
411
- }
412
- if (simpleAspect !== null &&
413
- (ctx.sourceStemIsVerb === true || simpleAspect.ellipticTeIruSourceHost === "verbal_predicate") &&
414
- !isVerb &&
415
- opPreNeg === null &&
416
- !opPast) {
417
- const ellipticNegative = sourceVerbAdjectivalEllipticTeIruNegativeBaseResult(simpleAspect, inputBase, ctx.lookups);
418
- if (ellipticNegative !== null)
419
- return withInputPrefix(ellipticNegative);
420
- if (!ctx.hasPriorChainOp) {
421
- const directional = sourceVerbAdjectivalDirectionalAspectBaseResult(simpleAspect, inputBase);
422
- if (directional !== null)
423
- return directional;
424
- }
425
- }
426
- const compositeInput = ctx.hasPriorChainOp === true;
427
- if (op.aspect === "te_iru" &&
428
- op.collapsed === "honorific" &&
429
- !isVerb &&
430
- opPreNeg === null &&
431
- !opPast) {
432
- return { ok: true, base: inputBase, chainOnFinalSupported: true };
433
- }
434
- if (simpleAspect !== null &&
435
- ctx.sourceStemIsVerb === true &&
436
- !ctx.hasPriorChainOp &&
437
- !isVerb &&
438
- opPreNeg === null &&
439
- !opPast) {
440
- const inchoative = sourceVerbAdjectivalTsutsuAruBaseResult(simpleAspect, inputBase);
441
- if (inchoative !== null)
442
- return inchoative;
443
- }
444
- if (!isVerb && !compositeInput)
445
- return { ok: false, reason: "te-aspect on adj 영역 외" };
446
- if (opPreNeg !== null) {
447
- const teComplementHostIsVerbal = isVerb || ctx.sourceStemIsVerb === true;
448
- if (opPreNeg.chainDepth !== 1 ||
449
- opPreNeg.chainPast ||
450
- !teComplementHostIsVerbal) {
451
- return { ok: false, reason: "V neg + aspect 영역 외" };
452
- }
453
- if (simpleAspect !== null) {
454
- return negativeTeAdverbialAspectBaseResult(simpleAspect, inputBase, ctx.lookups);
455
- }
456
- if (isBenefactiveAspectKind(op.aspect)) {
457
- const benefactive = op;
458
- const prohibitionRequest = benefactive.terminalMood === "imperative" ||
459
- benefactive.requestEvidence === "terminal_question";
460
- if (prohibitionRequest) {
461
- return benefactiveBaseFromInput(benefactive, prohibitionPredicateBase(inputBase));
462
- }
463
- const negativeInput = applyNegationChainToLemmaBase(inputBase, opPreNeg);
464
- if (negativeInput === null) {
465
- return { ok: false, reason: "negative benefactive host lowering 영역 외" };
466
- }
467
- return benefactiveBaseFromInput(benefactive, negativeInput);
468
- }
469
- return { ok: false, reason: "V neg + aspect 영역 외" };
470
- }
471
- if (opPast)
472
- return { ok: false, reason: "V past + aspect 영역 외" };
473
- if (isSimpleAspectOpKind(op.aspect)) {
474
- if (op.aspect === "te_shimau" &&
475
- op.semantic?.renderStrategy === "passive_completion" &&
476
- inputBase.policy?.kind === "voice" &&
477
- inputBase.policy.voice === "passive" &&
478
- inputBase.policy.adversativePassive === true &&
479
- inputBase.final.lemma === "버리다") {
480
- return {
481
- ok: true,
482
- base: inputBase,
483
- chainOnFinalSupported: true
484
- };
485
- }
486
- const simpleAspect = normalizeSimpleAspectForComposedInput(completionTeIruNegativeAspectForComposedInput(op, inputBase), inputBase);
487
- const shouldDropInputCompletionPolicy = simpleAspect.aspect === "te_iru" &&
488
- inputBase.policy?.kind === "completion" &&
489
- inputBase.policy.teIruNegativeStrategy === "preserve_aspect";
490
- return withInputPrefix(aspectBaseResult(simpleAspect, stemLemma, stemIrregular, ctx.lookups), { carryInputPolicy: !shouldDropInputCompletionPolicy });
491
- }
492
- if (op.aspect === "te_hoshii") {
493
- const desireBase = desiderativeBaseFromPredicateBase(inputBase, ctx.desiredPredicateNegation);
494
- if (desireBase === null) {
495
- return { ok: false, reason: "desired predicate negation + desiderative lowering 영역 외" };
496
- }
497
- const sourceTrace = teHoshiiSourceTrace(desireBase, op.source.tokens, ctx.desiredPredicateNegation);
498
- return {
499
- ok: true,
500
- base: desireBase,
501
- chainOnFinalSupported: true,
502
- interOpPastProjection: "committed",
503
- ...(sourceTrace === undefined ? {} : { sourceTrace })
504
- };
505
- }
506
- if (op.aspect === "te_miseru") {
507
- const base = miseruBase(op, stemLemma, stemIrregular);
508
- const sourceTrace = stemFusionSourceTrace(base.prefix, op.source.tokens, { splitFinal: "last_token" });
509
- return withInputPrefix({
510
- ok: true,
511
- base,
512
- chainOnFinalSupported: true,
513
- ...(sourceTrace === undefined ? {} : { sourceTrace })
514
- });
515
- }
516
- if (isBenefactiveAspectKind(op.aspect)) {
517
- return benefactiveBaseFromInput(op, inputBase);
518
- }
519
- return { ok: false, reason: `aspect kind '${op.aspect}' base 변환 미작성` };
291
+ case "aspect":
292
+ return aspectOpBase(op, inputBase, ctx);
293
+ case "desire":
294
+ return desireOpBase(op, inputBase, ctx);
295
+ case "voice":
296
+ return voiceOpBase(op, inputBase, ctx);
297
+ case "idiom":
298
+ return idiomOpBase(op, inputBase, ctx);
299
+ case "scopeBridge": {
300
+ return scopeBridgeBase(op, inputBase, ctx);
520
301
  }
521
- case "desire": {
522
- if (!isVerb && inputBase.prefix.length === 0) {
523
- return { ok: false, reason: "desire on adj 영역 외 (タイ는 V 만)" };
524
- }
525
- if (opPreNeg !== null)
526
- return { ok: false, reason: "V neg + desire 비표준" };
527
- if (inputBase.policy?.kind === "benefactive") {
528
- if (inputBase.policy.potential || inputBase.policy.desireMode === "unsupported") {
529
- return { ok: false, reason: "benefactive + desire policy 영역 외" };
530
- }
531
- if (inputBase.policy.desireMode === "request") {
532
- const requested = benefactiveDesiderativeRequestBase(inputBase);
533
- const requestBase = op.form === "tagaru"
534
- ? { ...requested, policy: { kind: "desire", nodaConnectiveFlatten: true } }
535
- : requested;
536
- const sourceTrace = hostProjectionSourceTrace({
537
- hostText: requestBase.prefix.trimEnd(),
538
- inputPrefix: inputBase.prefix,
539
- basePrefix: requestBase.prefix,
540
- sourceTokens: op.source.tokens,
541
- splitFinal: "none"
542
- });
543
- return {
544
- ok: true,
545
- base: requestBase,
546
- chainOnFinalSupported: true,
547
- interOpPastProjection: "committed",
548
- ...(sourceTrace === undefined ? {} : { sourceTrace })
549
- };
550
- }
551
- }
552
- const desireResult = desireBaseResult(stemLemma, stemIrregular);
553
- if (!desireResult.ok) {
554
- return desireResult;
555
- }
556
- return withInputPrefix({
557
- ...desireResult,
558
- ...(op.form === "tagaru" ? {
559
- base: {
560
- ...desireResult.base,
561
- final: { kind: "lemma", lemma: "싶어하다", irregular: "여", isVerb: true }
562
- }
563
- } : {}),
564
- sourceTrace: {
565
- inputProjectionText: desireResult.base.prefix,
566
- carrierPrefixSegments: [],
567
- finalSourceTokens: op.source.tokens,
568
- finalKind: "modal"
302
+ case "modal":
303
+ return modalOpBase(op, inputBase, ctx);
304
+ case "conjecture":
305
+ return conjectureOpBase(op, inputBase, ctx);
306
+ default:
307
+ return { ok: false, reason: `op kind not in chain dispatcher` };
308
+ }
309
+ }
310
+ function aspectOpBase(op, inputBase, ctx) {
311
+ const isVerb = inputBase.final.isVerb;
312
+ const opPreNeg = ctx.preModalNeg;
313
+ const opPast = ctx.past;
314
+ if (!isChainableAspectOpKind(op.aspect)) {
315
+ return { ok: false, reason: `aspect kind '${op.aspect}' not chainable — invariant violation` };
316
+ }
317
+ const simpleAspect = isSimpleAspectOpKind(op.aspect)
318
+ ? op
319
+ : null;
320
+ const absorbed = aspectAbsorbedIntoHostBase(op, simpleAspect, inputBase, ctx);
321
+ if (absorbed !== null)
322
+ return absorbed;
323
+ const bridged = aspectHostBridgeBase(op, simpleAspect, inputBase, ctx);
324
+ if (bridged !== null)
325
+ return bridged;
326
+ const compositeInput = ctx.hasPriorChainOp === true;
327
+ if (!isVerb && !compositeInput)
328
+ return { ok: false, reason: "te-aspect on adj 영역 외" };
329
+ if (opPreNeg !== null) {
330
+ return negativeHostAspectBase(op, simpleAspect, opPreNeg, inputBase, ctx);
331
+ }
332
+ if (opPast)
333
+ return { ok: false, reason: "V past + aspect 영역 외" };
334
+ return composedAspectBase(op, inputBase, ctx);
335
+ }
336
+ function aspectAbsorbedIntoHostBase(op, simpleAspect, inputBase, ctx) {
337
+ const isVerb = inputBase.final.isVerb;
338
+ const opPreNeg = ctx.preModalNeg;
339
+ const opPast = ctx.past;
340
+ const simpleAspectForDropAux = simpleAspect !== null &&
341
+ simpleAspect.aspect === "te_iru" &&
342
+ inputBase.policy?.kind === "accustomed_aspect_projection"
343
+ ? simpleAspectWithDropAuxSemantic(simpleAspect)
344
+ : simpleAspect;
345
+ if (simpleAspect !== null &&
346
+ simpleAspect.aspect === "te_iru" &&
347
+ simpleAspect.auxiliaryHonorific === "respect" &&
348
+ (!isVerb || simpleAspectForDropAux?.semantic?.renderStrategy === "drop_aux") &&
349
+ opPreNeg === null &&
350
+ !opPast &&
351
+ inputBase.final.kind === "lemma") {
352
+ return {
353
+ ok: true,
354
+ base: {
355
+ ...inputBase,
356
+ final: {
357
+ kind: "lemma",
358
+ lemma: `${conjugate(inputBase.final.lemma, inputBase.final.irregular, "(으)시")}다`,
359
+ irregular: null,
360
+ isVerb: inputBase.final.isVerb
569
361
  }
570
- });
362
+ },
363
+ chainOnFinalSupported: true
364
+ };
365
+ }
366
+ if (op.aspect === "te_iru" &&
367
+ inputBase.final.lemma === "있다" &&
368
+ !inputBase.final.isVerb &&
369
+ opPreNeg === null) {
370
+ const focusParticle = simpleAspect === null
371
+ ? undefined
372
+ : teIruAuxiliaryNegationFocusParticle(simpleAspect);
373
+ return {
374
+ ok: true,
375
+ base: inputBase,
376
+ chainOnFinalSupported: inputBase.policy?.kind === "benefactive" && inputBase.policy.potential
377
+ ? false
378
+ : true,
379
+ ...(focusParticle === undefined
380
+ ? {}
381
+ : { finalNegationOptions: { firstNegationFocusParticle: focusParticle } }),
382
+ ...(inputBase.policy?.kind === "benefactive" && inputBase.policy.potential
383
+ ? { finalNegationLoweringPolicy: "potential_idiom" }
384
+ : {})
385
+ };
386
+ }
387
+ if (op.aspect === "te_iru" &&
388
+ simpleAspectForDropAux?.semantic?.renderStrategy === "drop_aux") {
389
+ const focusParticle = teIruAuxiliaryNegationFocusParticle(simpleAspectForDropAux);
390
+ return {
391
+ ok: true,
392
+ base: inputBase,
393
+ chainOnFinalSupported: true,
394
+ ...(focusParticle === undefined
395
+ ? {}
396
+ : { finalNegationOptions: { firstNegationFocusParticle: focusParticle } }),
397
+ };
398
+ }
399
+ if (inputBase.policy?.kind === "accustomed_aspect_projection" &&
400
+ isSimpleAspectOpKind(op.aspect)) {
401
+ if (opPreNeg !== null)
402
+ return { ok: false, reason: "stative postverb neg + aspect 영역 외" };
403
+ if (opPast)
404
+ return { ok: false, reason: "stative postverb past + aspect 영역 외" };
405
+ const changedBase = stateChangeBase(inputBase, "adjectival");
406
+ if (!changedBase.final.isVerb) {
407
+ return { ok: false, reason: "stative postverb aspect change-base 영역 외" };
571
408
  }
572
- case "voice": {
573
- if (opPreNeg !== null)
574
- return { ok: false, reason: "V neg + voice 비표준" };
575
- const reportingStateBase = reportingPassiveStateBase(op, inputBase, ctx.nextOp);
576
- if (reportingStateBase !== null) {
577
- return reportingStateBase;
578
- }
579
- const reportingLabelBase = reportingPassiveLabelBase(op, inputBase);
580
- if (reportingLabelBase !== null) {
581
- return reportingLabelBase;
582
- }
583
- if (op.voice === "passive" &&
584
- inputBase.policy?.kind === "quoted_proposition" &&
585
- inputBase.final.lemma === "하다") {
586
- return {
587
- ok: true,
588
- base: {
589
- prefix: inputBase.prefix,
590
- final: { kind: "lemma", lemma: "여겨지다", irregular: null, isVerb: true },
591
- policy: { kind: "voice", voice: "passive", reportingPassive: true }
592
- },
593
- chainOnFinalSupported: true
594
- };
595
- }
596
- if (op.voice === "passive" && inputBase.policy?.kind === "make_state_change") {
597
- return {
598
- ok: true,
599
- base: {
600
- prefix: inputBase.prefix,
601
- final: { kind: "lemma", lemma: "되다", irregular: null, isVerb: true },
602
- policy: { kind: "voice", voice: "passive", ...(op.passiveClass === undefined ? {} : { passiveClass: op.passiveClass }) }
603
- },
604
- chainOnFinalSupported: true
605
- };
606
- }
607
- if (op.voice === "passive" && inputBase.policy?.kind === "causative") {
608
- const passiveCausative = voiceBase({
609
- voice: {
610
- ...op,
611
- voice: "causative_passive"
612
- },
613
- stemLemma: inputBase.policy.sourceLemma,
614
- stemIrregular: inputBase.policy.sourceIrregular,
615
- sahenShortNegationSplit: ctx.sahenShortNegationSplit,
616
- isVerb: true,
617
- passiveStemOptions: ctx.passiveStemOptions,
618
- lookups: ctx.lookups
619
- });
620
- return passiveCausative.ok
621
- ? { ...passiveCausative, chainOnFinalSupported: true }
622
- : passiveCausative;
623
- }
624
- if (op.voice === "passive" &&
625
- inputBase.policy?.kind === "completion" &&
626
- inputBase.policy.followingPassiveStrategy === "completion_causative") {
627
- return {
628
- ok: true,
629
- base: {
630
- prefix: `${inputBase.policy.stemPrefix ?? ""}${conjugate(inputBase.policy.stemLemma, inputBase.policy.stemIrregular, op.passiveClass === "causative_coercive" ? "아/어야" : "게")}${op.passiveClass === "causative_coercive" ? "만" : ""} `,
631
- final: op.passiveClass === "causative_coercive"
632
- ? { kind: "lemma", lemma: "하다", irregular: "여", isVerb: true }
633
- : { kind: "lemma", lemma: "되다", irregular: null, isVerb: true },
634
- policy: {
635
- kind: "voice",
636
- voice: "causative_passive",
637
- ...(op.passiveClass === undefined ? {} : { passiveClass: op.passiveClass })
638
- }
639
- },
640
- chainOnFinalSupported: true
641
- };
642
- }
643
- const res = voiceBase({
644
- voice: op,
645
- stemLemma,
646
- stemIrregular,
647
- isVerb,
648
- passiveStemOptions: ctx.passiveStemOptions,
649
- lookups: ctx.lookups,
650
- sahenShortNegationSplit: ctx.sahenShortNegationSplit,
651
- sourceTokens: op.source.tokens
652
- });
653
- if (!res.ok)
654
- return res;
655
- return withInputPrefix(res);
409
+ const aspectResult = aspectBaseResult(simpleAspectWithoutSemantic(op), changedBase.final.lemma, changedBase.final.irregular, ctx.lookups);
410
+ if (!aspectResult.ok)
411
+ return aspectResult;
412
+ const stativePrefix = `${changedBase.prefix}${aspectResult.base.prefix}`;
413
+ const stativeTrace = hostProjectionSourceTrace({
414
+ hostText: stativePrefix.trimEnd(),
415
+ inputPrefix: inputBase.prefix,
416
+ basePrefix: stativePrefix,
417
+ sourceTokens: op.source.tokens,
418
+ splitFinal: "none"
419
+ });
420
+ const { sourceTrace: _stativeCarried, ...stativeRest } = aspectResult;
421
+ void _stativeCarried;
422
+ return {
423
+ ...stativeRest,
424
+ base: {
425
+ ...aspectResult.base,
426
+ prefix: stativePrefix
427
+ },
428
+ ...(stativeTrace === undefined ? {} : { sourceTrace: stativeTrace })
429
+ };
430
+ }
431
+ return null;
432
+ }
433
+ function aspectHostBridgeBase(op, simpleAspect, inputBase, ctx) {
434
+ const isVerb = inputBase.final.isVerb;
435
+ const opPreNeg = ctx.preModalNeg;
436
+ const opPast = ctx.past;
437
+ if (opPreNeg === null && !opPast) {
438
+ const potentialDirection = potentialDirectionalAspectBaseResult(op, inputBase);
439
+ if (potentialDirection !== null) {
440
+ return potentialDirection;
656
441
  }
657
- case "idiom": {
658
- if (op.idiom === "wake_impossible") {
659
- return wakeImpossibleBase({
660
- op,
661
- inputBase,
662
- preStemNeg: opPreNeg,
663
- stemPast: opPast,
664
- formal: ctx.formal,
665
- pastProjection: ctx.pastProjection
666
- });
667
- }
668
- if (op.idiom === "obligation") {
669
- if (inputBase.policy?.kind === "noun_copula_interop" ||
670
- inputBase.policy?.kind === "negative_noun_copula_interop") {
671
- return {
672
- ok: true,
673
- base: nounCopulaObligationBase(inputBase.policy.nounSurface, predicateBasePolicyAllomorphHost(inputBase)),
674
- chainOnFinalSupported: true
675
- };
676
- }
677
- const res = obligationBase({ obligation: op, stemLemma, stemIrregular, isVerb });
678
- if (!res.ok)
679
- return res;
680
- return withInputPrefix({ ...res, chainOnFinalSupported: true });
681
- }
682
- if (op.idiom === "forbidden") {
683
- const res = forbiddenBase({ stemLemma, stemIrregular, isVerb, sourceTokens: op.source.tokens });
684
- if (!res.ok)
685
- return res;
686
- return withInputPrefix({ ...res, chainOnFinalSupported: true });
687
- }
688
- if (op.idiom === "degree_intensifier") {
689
- return degreeIntensifierBase({
690
- op,
691
- inputBase,
692
- preStemNeg: opPreNeg,
693
- stemPast: opPast,
694
- formal: ctx.formal,
695
- lookups: ctx.lookups
696
- });
697
- }
698
- if (op.idiom === "potential_koto_ga_dekiru") {
699
- if (inputBase.policy?.kind === "potential") {
700
- return {
701
- ok: true,
702
- base: inputBase,
703
- chainOnFinalSupported: false,
704
- finalNegationLoweringPolicy: "potential_idiom"
705
- };
706
- }
707
- if (inputBase.policy?.kind === "likeness" &&
708
- inputBase.policy.potentialObjectAttributive !== undefined) {
709
- const host = inputBase.policy.potentialObjectAttributive;
710
- const stemAttr = `${conjugate(host.stemLemma, host.stemIrregular, "ㄹ/을")} 만한`;
711
- return potentialObjectBaseFromAttributive({
712
- stemAttr,
713
- postIdiomChainDepth: 0,
714
- particleKind: op.particleKind,
715
- focusParticle: op.focusParticle,
716
- stemLemma: host.stemLemma,
717
- stemIrregular: host.stemIrregular
718
- });
719
- }
720
- const sourceProjectionIsVerbalPredicate = (ctx.sourceStemIsVerb ?? isVerb) ||
721
- ctx.sourceStemIsSahenPredicate === true;
722
- if (!isVerb && ctx.sourceStemIsSahenPredicate !== true) {
723
- const stemAttr = pastNegStemAttributive({
724
- stemLemma,
725
- stemIrregular,
726
- stemKind: "adj",
727
- past: opPast,
728
- preModalNeg: opPreNeg,
729
- attrPolicy: "present",
730
- useShortHint: false,
731
- lookups: ctx.lookups,
732
- sahenShortNegationSplit: ctx.sahenShortNegationSplit
733
- });
734
- return potentialObjectBaseFromAttributive({
735
- stemAttr,
736
- postIdiomChainDepth: 0,
737
- particleKind: op.particleKind,
738
- focusParticle: op.focusParticle,
739
- stemLemma,
740
- stemIrregular
741
- });
742
- }
743
- const res = potentialBase({
744
- stemLemma, stemIrregular, isVerb,
745
- sourceStemIsVerb: sourceProjectionIsVerbalPredicate,
746
- preStemNeg: opPreNeg,
747
- stemPast: opPast,
748
- postIdiomChainDepth: 0,
749
- particleKind: op.particleKind,
750
- focusParticle: op.focusParticle,
751
- sourceTokens: op.source.tokens,
752
- lookups: ctx.lookups,
753
- sahenShortNegationSplit: ctx.sahenShortNegationSplit
754
- });
755
- if (!res.ok)
756
- return res;
757
- return withInputPrefix({
758
- ...res,
759
- chainOnFinalSupported: false,
760
- finalNegationLoweringPolicy: "potential_idiom"
761
- });
762
- }
763
- if (op.idiom === "negative_necessity_koto_wa") {
764
- return negativeNecessityKotoWaBase({
765
- op,
766
- inputBase,
767
- preStemNeg: opPreNeg,
768
- stemPast: opPast,
769
- formal: ctx.formal,
770
- pastProjection: ctx.pastProjection
771
- });
772
- }
773
- if (op.idiom === "inevitable_zaru_o_enai") {
774
- return inevitableZaruOEnaiBase({
775
- inputBase,
776
- preStemNeg: opPreNeg,
777
- stemPast: opPast,
778
- formal: ctx.formal,
779
- pastProjection: ctx.pastProjection,
780
- sourceTokens: op.source.tokens
781
- });
782
- }
783
- if (op.idiom === "cannot_refrain_negative_dewa_irarenai") {
784
- return cannotRefrainNegativeDewaIrarenaiBase({
785
- inputBase,
786
- preStemNeg: opPreNeg,
787
- stemPast: opPast,
788
- formal: ctx.formal,
789
- pastProjection: ctx.pastProjection,
790
- sourceTokens: op.source.tokens
791
- });
792
- }
793
- if (op.idiom === "method_you_ga_nai") {
794
- return methodYouGaNaiBase({
795
- op,
796
- inputBase,
797
- preStemNeg: opPreNeg,
798
- stemPast: opPast,
799
- formal: ctx.formal,
800
- pastProjection: ctx.pastProjection,
801
- sourceTokens: op.source.tokens
802
- });
803
- }
804
- if (op.idiom === "negative_necessity_made_mo") {
805
- return madeMoNaiBase({
806
- inputBase,
807
- preStemNeg: opPreNeg,
808
- stemPast: opPast,
809
- formal: ctx.formal,
810
- pastProjection: ctx.pastProjection,
811
- sourceTokens: op.source.tokens
812
- });
813
- }
814
- if (op.idiom === "permission") {
815
- return permissionBase({
816
- op,
817
- inputBase,
818
- preStemNeg: opPreNeg,
819
- stemPast: opPast,
820
- formal: ctx.formal,
821
- lookups: ctx.lookups
822
- });
823
- }
824
- if (op.idiom === "sufficiency_conditional") {
825
- return sufficiencyConditionalBase({
826
- op,
827
- inputBase,
828
- preStemNeg: opPreNeg,
829
- stemPast: opPast,
830
- formal: ctx.formal,
831
- lookups: ctx.lookups
832
- });
833
- }
834
- if (op.idiom === "te_evaluation") {
835
- return teEvaluationBase({
836
- op,
837
- inputBase,
838
- preStemNeg: opPreNeg,
839
- stemPast: opPast,
840
- formal: ctx.formal,
841
- lookups: ctx.lookups
842
- });
843
- }
844
- if (op.idiom === "negative_necessity_sumu") {
845
- return negativeNecessitySumuBase({
846
- op,
847
- inputBase,
848
- preStemNeg: opPreNeg,
849
- stemPast: opPast,
850
- formal: ctx.formal,
851
- lookups: ctx.lookups
852
- });
853
- }
854
- if (op.idiom === "only_option_shika_nai") {
855
- return onlyOptionBase({
856
- inputBase,
857
- preStemNeg: opPreNeg,
858
- stemPast: opPast,
859
- formal: ctx.formal,
860
- pastProjection: ctx.pastProjection,
861
- lookups: ctx.lookups,
862
- sourceTokens: op.source.tokens
863
- });
864
- }
865
- if (op.idiom === "experience_koto_ga_aru") {
866
- return experienceBase({
867
- op,
868
- inputBase,
869
- preStemNeg: opPreNeg,
870
- stemPast: opPast,
871
- formal: ctx.formal,
872
- pastProjection: ctx.pastProjection
873
- });
874
- }
875
- if (op.idiom === "outcome_koto_ni_naru") {
876
- return outcomeKotoNiNaruBase({
877
- op,
878
- inputBase,
879
- preStemNeg: opPreNeg,
880
- stemPast: opPast,
881
- formal: ctx.formal,
882
- pastProjection: ctx.pastProjection
883
- });
884
- }
885
- return decisionKotoNiSuruBase({
886
- inputBase,
887
- preStemNeg: opPreNeg,
888
- stemPast: opPast,
889
- formal: ctx.formal,
890
- sourceTokens: op.source.tokens
442
+ }
443
+ if (op.aspect === "te_shimau" &&
444
+ simpleAspect !== null &&
445
+ ctx.sourceStemIsVerb === true &&
446
+ !ctx.hasPriorChainOp &&
447
+ !isVerb &&
448
+ opPreNeg === null &&
449
+ !opPast) {
450
+ const bridged = sourceVerbAdjectivalTeShimauBaseResult(simpleAspect, inputBase);
451
+ if (bridged !== null)
452
+ return bridged;
453
+ }
454
+ if (op.aspect === "te_iru" &&
455
+ ctx.sourceStemIsSahenPredicate === true &&
456
+ !isVerb &&
457
+ opPreNeg === null &&
458
+ !opPast) {
459
+ return {
460
+ ok: true,
461
+ base: inputBase,
462
+ chainOnFinalSupported: true
463
+ };
464
+ }
465
+ if (simpleAspect !== null &&
466
+ (ctx.sourceStemIsVerb === true || simpleAspect.ellipticTeIruSourceHost === "verbal_predicate") &&
467
+ !isVerb &&
468
+ opPreNeg === null &&
469
+ !opPast) {
470
+ const ellipticNegative = sourceVerbAdjectivalEllipticTeIruNegativeBaseResult(simpleAspect, inputBase, ctx.lookups);
471
+ if (ellipticNegative !== null)
472
+ return withInputPrefix(inputBase, ellipticNegative);
473
+ if (!ctx.hasPriorChainOp) {
474
+ const directional = sourceVerbAdjectivalDirectionalAspectBaseResult(simpleAspect, inputBase);
475
+ if (directional !== null)
476
+ return directional;
477
+ }
478
+ }
479
+ if (op.aspect === "te_iru" &&
480
+ op.collapsed === "honorific" &&
481
+ !isVerb &&
482
+ opPreNeg === null &&
483
+ !opPast) {
484
+ return { ok: true, base: inputBase, chainOnFinalSupported: true };
485
+ }
486
+ if (simpleAspect !== null &&
487
+ ctx.sourceStemIsVerb === true &&
488
+ !ctx.hasPriorChainOp &&
489
+ !isVerb &&
490
+ opPreNeg === null &&
491
+ !opPast) {
492
+ const inchoative = sourceVerbAdjectivalTsutsuAruBaseResult(simpleAspect, inputBase);
493
+ if (inchoative !== null)
494
+ return inchoative;
495
+ }
496
+ return null;
497
+ }
498
+ function negativeHostAspectBase(op, simpleAspect, opPreNeg, inputBase, ctx) {
499
+ const isVerb = inputBase.final.isVerb;
500
+ const teComplementHostIsVerbal = isVerb || ctx.sourceStemIsVerb === true;
501
+ if (opPreNeg.chainDepth !== 1 ||
502
+ opPreNeg.chainPast ||
503
+ !teComplementHostIsVerbal) {
504
+ return { ok: false, reason: "V neg + aspect 영역 외" };
505
+ }
506
+ if (simpleAspect !== null) {
507
+ return negativeTeAdverbialAspectBaseResult(simpleAspect, inputBase, ctx.lookups);
508
+ }
509
+ if (isBenefactiveAspectKind(op.aspect)) {
510
+ const benefactive = op;
511
+ const prohibitionRequest = benefactive.terminalMood === "imperative" ||
512
+ benefactive.requestEvidence === "terminal_question";
513
+ if (prohibitionRequest) {
514
+ return benefactiveBaseFromInput(benefactive, prohibitionPredicateBase(inputBase));
515
+ }
516
+ const negativeInput = applyNegationChainToLemmaBase(inputBase, opPreNeg);
517
+ if (negativeInput === null) {
518
+ return { ok: false, reason: "negative benefactive host lowering 영역 외" };
519
+ }
520
+ return benefactiveBaseFromInput(benefactive, negativeInput);
521
+ }
522
+ return { ok: false, reason: "V neg + aspect 영역 외" };
523
+ }
524
+ function composedAspectBase(op, inputBase, ctx) {
525
+ const stemLemma = inputBase.final.lemma;
526
+ const stemIrregular = inputBase.final.irregular;
527
+ if (isSimpleAspectOpKind(op.aspect)) {
528
+ if (op.aspect === "te_shimau" &&
529
+ op.semantic?.renderStrategy === "passive_completion" &&
530
+ inputBase.policy?.kind === "voice" &&
531
+ inputBase.policy.voice === "passive" &&
532
+ inputBase.policy.adversativePassive === true &&
533
+ inputBase.final.lemma === "버리다") {
534
+ return {
535
+ ok: true,
536
+ base: inputBase,
537
+ chainOnFinalSupported: true
538
+ };
539
+ }
540
+ const simpleAspect = normalizeSimpleAspectForComposedInput(completionTeIruNegativeAspectForComposedInput(op, inputBase), inputBase);
541
+ const shouldDropInputCompletionPolicy = simpleAspect.aspect === "te_iru" &&
542
+ inputBase.policy?.kind === "completion" &&
543
+ inputBase.policy.teIruNegativeStrategy === "preserve_aspect";
544
+ return withInputPrefix(inputBase, aspectBaseResult(simpleAspect, stemLemma, stemIrregular, ctx.lookups), { carryInputPolicy: !shouldDropInputCompletionPolicy });
545
+ }
546
+ if (op.aspect === "te_hoshii") {
547
+ const desireBase = desiderativeBaseFromPredicateBase(inputBase, ctx.desiredPredicateNegation);
548
+ if (desireBase === null) {
549
+ return { ok: false, reason: "desired predicate negation + desiderative lowering 영역 외" };
550
+ }
551
+ const sourceTrace = teHoshiiSourceTrace(desireBase, op.source.tokens, ctx.desiredPredicateNegation);
552
+ return {
553
+ ok: true,
554
+ base: desireBase,
555
+ chainOnFinalSupported: true,
556
+ interOpPastProjection: "committed",
557
+ ...(sourceTrace === undefined ? {} : { sourceTrace })
558
+ };
559
+ }
560
+ if (op.aspect === "te_miseru") {
561
+ const base = miseruBase(op, stemLemma, stemIrregular);
562
+ const sourceTrace = stemFusionSourceTrace(base.prefix, op.source.tokens, { splitFinal: "last_token" });
563
+ return withInputPrefix(inputBase, {
564
+ ok: true,
565
+ base,
566
+ chainOnFinalSupported: true,
567
+ ...(sourceTrace === undefined ? {} : { sourceTrace })
568
+ });
569
+ }
570
+ if (isBenefactiveAspectKind(op.aspect)) {
571
+ return benefactiveBaseFromInput(op, inputBase);
572
+ }
573
+ return { ok: false, reason: `aspect kind '${op.aspect}' base 변환 미작성` };
574
+ }
575
+ function desireOpBase(op, inputBase, ctx) {
576
+ const stemLemma = inputBase.final.lemma;
577
+ const stemIrregular = inputBase.final.irregular;
578
+ const isVerb = inputBase.final.isVerb;
579
+ const opPreNeg = ctx.preModalNeg;
580
+ if (!isVerb && inputBase.prefix.length === 0) {
581
+ return { ok: false, reason: "desire on adj 영역 외 (タイ는 V 만)" };
582
+ }
583
+ if (opPreNeg !== null)
584
+ return { ok: false, reason: "V neg + desire 비표준" };
585
+ if (inputBase.policy?.kind === "benefactive") {
586
+ if (inputBase.policy.potential || inputBase.policy.desireMode === "unsupported") {
587
+ return { ok: false, reason: "benefactive + desire policy 영역 외" };
588
+ }
589
+ if (inputBase.policy.desireMode === "request") {
590
+ const requested = benefactiveDesiderativeRequestBase(inputBase);
591
+ const requestBase = op.form === "tagaru"
592
+ ? { ...requested, policy: { kind: "desire", nodaConnectiveFlatten: true } }
593
+ : requested;
594
+ const sourceTrace = hostProjectionSourceTrace({
595
+ hostText: requestBase.prefix.trimEnd(),
596
+ inputPrefix: inputBase.prefix,
597
+ basePrefix: requestBase.prefix,
598
+ sourceTokens: op.source.tokens,
599
+ splitFinal: "none"
891
600
  });
601
+ return {
602
+ ok: true,
603
+ base: requestBase,
604
+ chainOnFinalSupported: true,
605
+ interOpPastProjection: "committed",
606
+ ...(sourceTrace === undefined ? {} : { sourceTrace })
607
+ };
892
608
  }
893
- case "scopeBridge": {
894
- return scopeBridgeBase(op, inputBase, ctx);
609
+ }
610
+ const desireResult = desireBaseResult(stemLemma, stemIrregular);
611
+ if (!desireResult.ok) {
612
+ return desireResult;
613
+ }
614
+ return withInputPrefix(inputBase, {
615
+ ...desireResult,
616
+ ...(op.form === "tagaru" ? {
617
+ base: {
618
+ ...desireResult.base,
619
+ final: { kind: "lemma", lemma: "싶어하다", irregular: "여", isVerb: true }
620
+ }
621
+ } : {}),
622
+ sourceTrace: {
623
+ inputProjectionText: desireResult.base.prefix,
624
+ carrierPrefixSegments: [],
625
+ finalSourceTokens: op.source.tokens,
626
+ finalKind: "modal"
895
627
  }
896
- case "modal": {
897
- if (op.modal === "mai" &&
898
- (inputBase.policy?.kind === "noun_copula_interop" ||
899
- inputBase.policy?.kind === "negative_noun_copula_interop") &&
900
- opPreNeg === null &&
901
- !opPast) {
902
- const noun = inputBase.policy.nounSurface;
903
- const base = scopeCarrierCopulaBase("mai", "거", `${nounSubjectPart(noun, predicateBasePolicyAllomorphHost(inputBase))} 아닐 `);
904
- return {
905
- ok: true,
906
- base,
907
- ...modalFinalChainPolicy(base),
908
- interOpPastProjection: "committed"
909
- };
910
- }
911
- if (op.modal === "noda" &&
912
- inputBase.policy?.kind === "negative_noun_copula_interop" &&
913
- ctx.nextOp?.kind === "conjecture" &&
914
- opPreNeg === null &&
915
- !opPast) {
916
- return {
917
- ok: true,
918
- base: inputBase,
919
- chainOnFinalSupported: true
920
- };
921
- }
922
- if (op.modal === "tokoro") {
923
- const tokoroProjectedBase = tokoroBaseFromPredicateBase({
924
- modal: op,
925
- base: inputBase,
926
- preModalNeg: opPreNeg,
927
- past: opPast,
928
- formal: ctx.formal,
929
- pastProjection: ctx.pastProjection
930
- });
931
- if (tokoroProjectedBase !== null) {
932
- if (!tokoroProjectedBase.ok)
933
- return tokoroProjectedBase;
934
- return {
935
- ...tokoroProjectedBase,
936
- ...modalFinalChainPolicy(tokoroProjectedBase.base),
937
- interOpPastProjection: "committed"
938
- };
939
- }
940
- }
941
- if (op.modal === "limit_negation") {
942
- const res = limitNegationBaseFromPredicateBase({
943
- modal: op,
944
- base: inputBase,
945
- preNeg: opPreNeg,
946
- past: opPast,
947
- formal: ctx.formal,
948
- lookups: ctx.lookups
949
- });
950
- if (!res.ok)
951
- return res;
952
- return { ...res, ...modalFinalChainPolicy(res.base), interOpPastProjection: "committed" };
953
- }
954
- if (op.modal === "mono" && (op.reading === "admirative" || op.reading === "habitual")) {
955
- const res = monoHostPredicateBase(op, inputBase, opPreNeg);
956
- if (!res.ok)
957
- return res;
958
- return { ...res, ...modalFinalChainPolicy(res.base), interOpPastProjection: "committed" };
959
- }
960
- if (op.modal === "souda_hearsay" && op.reading === "hearsay") {
961
- const res = soudaHearsayBaseFromPredicateBase(inputBase, opPreNeg, opPast, ctx.lookups, op);
962
- if (!res.ok)
963
- return res;
964
- return { ...res, ...modalFinalChainPolicy(res.base), interOpPastProjection: "committed" };
965
- }
966
- if (op.modal === "noda" && opPreNeg === null && !opPast) {
967
- const absorbed = nodaCarrierAbsorbedByHostBoundNoun(inputBase, op);
968
- if (absorbed !== null) {
969
- return { ...absorbed, ...modalFinalChainPolicy(absorbed.base), interOpPastProjection: "committed" };
970
- }
971
- }
972
- if (op.modal === "kamo" && opPreNeg === null) {
973
- const carrierKamo = nodaCarrierKamoBase(inputBase, ctx.formal, opPast, op.bare);
974
- if (carrierKamo !== null) {
975
- return {
976
- ...carrierKamo,
977
- ...modalFinalChainPolicy(carrierKamo.base),
978
- interOpPastProjection: "committed"
979
- };
980
- }
981
- }
982
- if (op.modal === "wake") {
983
- const wakeCitation = wakeExplanatoryCitationBase({
984
- op, inputBase, preStemNeg: opPreNeg, stemPast: opPast, formal: ctx.formal
985
- });
986
- if (wakeCitation !== null) {
987
- if (!wakeCitation.ok)
988
- return wakeCitation;
989
- return {
990
- ...wakeCitation,
991
- ...modalFinalChainPolicy(wakeCitation.base),
992
- interOpPastProjection: "committed"
993
- };
994
- }
995
- }
996
- if ((op.modal === "rashii" || op.modal === "youda") && opPreNeg === null && !opPast) {
997
- const carrierLikeness = nodaCarrierLikenessBase(inputBase);
998
- if (carrierLikeness !== null) {
999
- return {
1000
- ...carrierLikeness,
1001
- ...modalFinalChainPolicy(carrierLikeness.base),
1002
- interOpPastProjection: "committed"
1003
- };
1004
- }
1005
- const quotedLikeness = quotedPropositionLikenessBase(inputBase, op, ctx.formal, ctx.pastProjection);
1006
- if (quotedLikeness !== null) {
1007
- return {
1008
- ...quotedLikeness,
1009
- ...modalFinalChainPolicy(quotedLikeness.base),
1010
- interOpPastProjection: "committed"
1011
- };
1012
- }
1013
- }
1014
- if (op.modal === "rashii" &&
1015
- opPreNeg === null &&
1016
- !opPast &&
1017
- !ctx.hasPriorChainOp &&
1018
- inputBase.policy?.kind === "noun_copula_interop" &&
1019
- inputBase.policy.zeroCopula === true) {
1020
- const res = nominalHostEvidentialLikenessBase(inputBase.policy.nounSurface, op);
1021
- if (!res.ok)
1022
- return res;
1023
- return { ...res, ...modalFinalChainPolicy(res.base), interOpPastProjection: "committed" };
1024
- }
1025
- if (op.modal === "mai" && opPreNeg === null && !opPast) {
1026
- const scopeMai = maiScopeCarrierBase(op, inputBase);
1027
- if (scopeMai !== null) {
1028
- if (!scopeMai.ok)
1029
- return scopeMai;
1030
- return { ...scopeMai, ...modalFinalChainPolicy(scopeMai.base) };
628
+ });
629
+ }
630
+ function voiceOpBase(op, inputBase, ctx) {
631
+ const stemLemma = inputBase.final.lemma;
632
+ const stemIrregular = inputBase.final.irregular;
633
+ const isVerb = inputBase.final.isVerb;
634
+ const opPreNeg = ctx.preModalNeg;
635
+ if (opPreNeg !== null)
636
+ return { ok: false, reason: "V neg + voice 비표준" };
637
+ const reportingStateBase = reportingPassiveStateBase(op, inputBase, ctx.nextOp);
638
+ if (reportingStateBase !== null) {
639
+ return reportingStateBase;
640
+ }
641
+ const reportingLabelBase = reportingPassiveLabelBase(op, inputBase);
642
+ if (reportingLabelBase !== null) {
643
+ return reportingLabelBase;
644
+ }
645
+ if (op.voice === "passive" &&
646
+ inputBase.policy?.kind === "quoted_proposition" &&
647
+ inputBase.final.lemma === "하다") {
648
+ return {
649
+ ok: true,
650
+ base: {
651
+ prefix: inputBase.prefix,
652
+ final: { kind: "lemma", lemma: "여겨지다", irregular: null, isVerb: true },
653
+ policy: { kind: "voice", voice: "passive", reportingPassive: true }
654
+ },
655
+ chainOnFinalSupported: true
656
+ };
657
+ }
658
+ if (op.voice === "passive" && inputBase.policy?.kind === "make_state_change") {
659
+ return {
660
+ ok: true,
661
+ base: {
662
+ prefix: inputBase.prefix,
663
+ final: { kind: "lemma", lemma: "되다", irregular: null, isVerb: true },
664
+ policy: { kind: "voice", voice: "passive", ...(op.passiveClass === undefined ? {} : { passiveClass: op.passiveClass }) }
665
+ },
666
+ chainOnFinalSupported: true
667
+ };
668
+ }
669
+ if (op.voice === "passive" && inputBase.policy?.kind === "causative") {
670
+ const passiveCausative = voiceBase({
671
+ voice: {
672
+ ...op,
673
+ voice: "causative_passive"
674
+ },
675
+ stemLemma: inputBase.policy.sourceLemma,
676
+ stemIrregular: inputBase.policy.sourceIrregular,
677
+ sahenShortNegationSplit: ctx.sahenShortNegationSplit,
678
+ isVerb: true,
679
+ passiveStemOptions: ctx.passiveStemOptions,
680
+ lookups: ctx.lookups
681
+ });
682
+ return passiveCausative.ok
683
+ ? { ...passiveCausative, chainOnFinalSupported: true }
684
+ : passiveCausative;
685
+ }
686
+ if (op.voice === "passive" &&
687
+ inputBase.policy?.kind === "completion" &&
688
+ inputBase.policy.followingPassiveStrategy === "completion_causative") {
689
+ return {
690
+ ok: true,
691
+ base: {
692
+ prefix: `${inputBase.policy.stemPrefix ?? ""}${conjugate(inputBase.policy.stemLemma, inputBase.policy.stemIrregular, op.passiveClass === "causative_coercive" ? "아/어야" : "게")}${op.passiveClass === "causative_coercive" ? "만" : ""} `,
693
+ final: op.passiveClass === "causative_coercive"
694
+ ? { kind: "lemma", lemma: "하다", irregular: "여", isVerb: true }
695
+ : { kind: "lemma", lemma: "되다", irregular: null, isVerb: true },
696
+ policy: {
697
+ kind: "voice",
698
+ voice: "causative_passive",
699
+ ...(op.passiveClass === undefined ? {} : { passiveClass: op.passiveClass })
1031
700
  }
1032
- }
1033
- const res = modalBase({
1034
- modal: op, stemLemma, stemIrregular,
1035
- stemKind: op.modal === "mai" ? (inputBase.final.isVerb ? "verb" : "adj") : (isVerb ? "verb" : "adj"),
1036
- preModalNeg: opPreNeg,
1037
- past: opPast,
1038
- pastProjection: ctx.pastProjection,
1039
- formal: ctx.formal,
1040
- ...(inputBase.policy === undefined ? {} : { inputPolicy: inputBase.policy }),
1041
- ...(ctx.sourceStemIsVerb === undefined ? {} : { sourceStemIsVerb: ctx.sourceStemIsVerb }),
1042
- sourceHostHasTeIruAspect: ctx.sourceHostHasTeIruAspect === true,
1043
- forbidShortNegation: ctx.forbidShortNegation,
1044
- preferShortLikenessNegation: ctx.preferShortLikenessNegation === true || opPreNeg !== null,
1045
- lookups: ctx.lookups,
1046
- sahenShortNegationSplit: ctx.sahenShortNegationSplit
1047
- });
1048
- if (!res.ok)
1049
- return res;
1050
- return withInputPrefix({
1051
- ...res,
1052
- ...modalFinalChainPolicy(res.base),
701
+ },
702
+ chainOnFinalSupported: true
703
+ };
704
+ }
705
+ const res = voiceBase({
706
+ voice: op,
707
+ stemLemma,
708
+ stemIrregular,
709
+ isVerb,
710
+ passiveStemOptions: ctx.passiveStemOptions,
711
+ lookups: ctx.lookups,
712
+ sahenShortNegationSplit: ctx.sahenShortNegationSplit,
713
+ sourceTokens: op.source.tokens
714
+ });
715
+ if (!res.ok)
716
+ return res;
717
+ return withInputPrefix(inputBase, res);
718
+ }
719
+ function idiomOpBase(op, inputBase, ctx) {
720
+ const stemLemma = inputBase.final.lemma;
721
+ const stemIrregular = inputBase.final.irregular;
722
+ const isVerb = inputBase.final.isVerb;
723
+ const opPreNeg = ctx.preModalNeg;
724
+ const opPast = ctx.past;
725
+ if (op.idiom === "wake_impossible") {
726
+ return wakeImpossibleBase({
727
+ op,
728
+ inputBase,
729
+ preStemNeg: opPreNeg,
730
+ stemPast: opPast,
731
+ formal: ctx.formal,
732
+ pastProjection: ctx.pastProjection
733
+ });
734
+ }
735
+ if (op.idiom === "obligation") {
736
+ if (inputBase.policy?.kind === "noun_copula_interop" ||
737
+ inputBase.policy?.kind === "negative_noun_copula_interop") {
738
+ return {
739
+ ok: true,
740
+ base: nounCopulaObligationBase(inputBase.policy.nounSurface, predicateBasePolicyAllomorphHost(inputBase)),
741
+ chainOnFinalSupported: true
742
+ };
743
+ }
744
+ const res = obligationBase({ obligation: op, stemLemma, stemIrregular, isVerb });
745
+ if (!res.ok)
746
+ return res;
747
+ return withInputPrefix(inputBase, { ...res, chainOnFinalSupported: true });
748
+ }
749
+ if (op.idiom === "forbidden") {
750
+ const res = forbiddenBase({ stemLemma, stemIrregular, isVerb, sourceTokens: op.source.tokens });
751
+ if (!res.ok)
752
+ return res;
753
+ return withInputPrefix(inputBase, { ...res, chainOnFinalSupported: true });
754
+ }
755
+ if (op.idiom === "degree_intensifier") {
756
+ return degreeIntensifierBase({
757
+ op,
758
+ inputBase,
759
+ preStemNeg: opPreNeg,
760
+ stemPast: opPast,
761
+ formal: ctx.formal,
762
+ lookups: ctx.lookups
763
+ });
764
+ }
765
+ if (op.idiom === "potential_koto_ga_dekiru") {
766
+ return potentialKotoGaDekiruIdiomBase(op, inputBase, ctx);
767
+ }
768
+ if (op.idiom === "negative_necessity_koto_wa") {
769
+ return negativeNecessityKotoWaBase({
770
+ op,
771
+ inputBase,
772
+ preStemNeg: opPreNeg,
773
+ stemPast: opPast,
774
+ formal: ctx.formal,
775
+ pastProjection: ctx.pastProjection
776
+ });
777
+ }
778
+ if (op.idiom === "inevitable_zaru_o_enai") {
779
+ return inevitableZaruOEnaiBase({
780
+ inputBase,
781
+ preStemNeg: opPreNeg,
782
+ stemPast: opPast,
783
+ formal: ctx.formal,
784
+ pastProjection: ctx.pastProjection,
785
+ sourceTokens: op.source.tokens
786
+ });
787
+ }
788
+ if (op.idiom === "cannot_refrain_negative_dewa_irarenai") {
789
+ return cannotRefrainNegativeDewaIrarenaiBase({
790
+ inputBase,
791
+ preStemNeg: opPreNeg,
792
+ stemPast: opPast,
793
+ formal: ctx.formal,
794
+ pastProjection: ctx.pastProjection,
795
+ sourceTokens: op.source.tokens
796
+ });
797
+ }
798
+ if (op.idiom === "method_you_ga_nai") {
799
+ return methodYouGaNaiBase({
800
+ op,
801
+ inputBase,
802
+ preStemNeg: opPreNeg,
803
+ stemPast: opPast,
804
+ formal: ctx.formal,
805
+ pastProjection: ctx.pastProjection,
806
+ sourceTokens: op.source.tokens
807
+ });
808
+ }
809
+ if (op.idiom === "negative_necessity_made_mo") {
810
+ return madeMoNaiBase({
811
+ inputBase,
812
+ preStemNeg: opPreNeg,
813
+ stemPast: opPast,
814
+ formal: ctx.formal,
815
+ pastProjection: ctx.pastProjection,
816
+ sourceTokens: op.source.tokens
817
+ });
818
+ }
819
+ if (op.idiom === "permission") {
820
+ return permissionBase({
821
+ op,
822
+ inputBase,
823
+ preStemNeg: opPreNeg,
824
+ stemPast: opPast,
825
+ formal: ctx.formal,
826
+ lookups: ctx.lookups
827
+ });
828
+ }
829
+ if (op.idiom === "sufficiency_conditional") {
830
+ return sufficiencyConditionalBase({
831
+ op,
832
+ inputBase,
833
+ preStemNeg: opPreNeg,
834
+ stemPast: opPast,
835
+ formal: ctx.formal,
836
+ lookups: ctx.lookups
837
+ });
838
+ }
839
+ if (op.idiom === "te_evaluation") {
840
+ return teEvaluationBase({
841
+ op,
842
+ inputBase,
843
+ preStemNeg: opPreNeg,
844
+ stemPast: opPast,
845
+ formal: ctx.formal,
846
+ lookups: ctx.lookups
847
+ });
848
+ }
849
+ if (op.idiom === "negative_necessity_sumu") {
850
+ return negativeNecessitySumuBase({
851
+ op,
852
+ inputBase,
853
+ preStemNeg: opPreNeg,
854
+ stemPast: opPast,
855
+ formal: ctx.formal,
856
+ lookups: ctx.lookups
857
+ });
858
+ }
859
+ if (op.idiom === "only_option_shika_nai") {
860
+ return onlyOptionBase({
861
+ inputBase,
862
+ preStemNeg: opPreNeg,
863
+ stemPast: opPast,
864
+ formal: ctx.formal,
865
+ pastProjection: ctx.pastProjection,
866
+ lookups: ctx.lookups,
867
+ sourceTokens: op.source.tokens
868
+ });
869
+ }
870
+ if (op.idiom === "experience_koto_ga_aru") {
871
+ return experienceBase({
872
+ op,
873
+ inputBase,
874
+ preStemNeg: opPreNeg,
875
+ stemPast: opPast,
876
+ formal: ctx.formal,
877
+ pastProjection: ctx.pastProjection
878
+ });
879
+ }
880
+ if (op.idiom === "outcome_koto_ni_naru") {
881
+ return outcomeKotoNiNaruBase({
882
+ op,
883
+ inputBase,
884
+ preStemNeg: opPreNeg,
885
+ stemPast: opPast,
886
+ formal: ctx.formal,
887
+ pastProjection: ctx.pastProjection
888
+ });
889
+ }
890
+ return decisionKotoNiSuruBase({
891
+ inputBase,
892
+ preStemNeg: opPreNeg,
893
+ stemPast: opPast,
894
+ formal: ctx.formal,
895
+ sourceTokens: op.source.tokens
896
+ });
897
+ }
898
+ function potentialKotoGaDekiruIdiomBase(op, inputBase, ctx) {
899
+ const stemLemma = inputBase.final.lemma;
900
+ const stemIrregular = inputBase.final.irregular;
901
+ const isVerb = inputBase.final.isVerb;
902
+ const opPreNeg = ctx.preModalNeg;
903
+ const opPast = ctx.past;
904
+ if (inputBase.policy?.kind === "potential") {
905
+ return {
906
+ ok: true,
907
+ base: inputBase,
908
+ chainOnFinalSupported: false,
909
+ finalNegationLoweringPolicy: "potential_idiom"
910
+ };
911
+ }
912
+ if (inputBase.policy?.kind === "likeness" &&
913
+ inputBase.policy.potentialObjectAttributive !== undefined) {
914
+ const host = inputBase.policy.potentialObjectAttributive;
915
+ const stemAttr = `${conjugate(host.stemLemma, host.stemIrregular, "ㄹ/을")} 만한`;
916
+ return potentialObjectBaseFromAttributive({
917
+ stemAttr,
918
+ postIdiomChainDepth: 0,
919
+ particleKind: op.particleKind,
920
+ focusParticle: op.focusParticle,
921
+ stemLemma: host.stemLemma,
922
+ stemIrregular: host.stemIrregular
923
+ });
924
+ }
925
+ const sourceProjectionIsVerbalPredicate = (ctx.sourceStemIsVerb ?? isVerb) ||
926
+ ctx.sourceStemIsSahenPredicate === true;
927
+ if (!isVerb && ctx.sourceStemIsSahenPredicate !== true) {
928
+ const stemAttr = pastNegStemAttributive({
929
+ stemLemma,
930
+ stemIrregular,
931
+ stemKind: "adj",
932
+ past: opPast,
933
+ preModalNeg: opPreNeg,
934
+ attrPolicy: "present",
935
+ useShortHint: false,
936
+ lookups: ctx.lookups,
937
+ sahenShortNegationSplit: ctx.sahenShortNegationSplit
938
+ });
939
+ return potentialObjectBaseFromAttributive({
940
+ stemAttr,
941
+ postIdiomChainDepth: 0,
942
+ particleKind: op.particleKind,
943
+ focusParticle: op.focusParticle,
944
+ stemLemma,
945
+ stemIrregular
946
+ });
947
+ }
948
+ const res = potentialBase({
949
+ stemLemma, stemIrregular, isVerb,
950
+ sourceStemIsVerb: sourceProjectionIsVerbalPredicate,
951
+ preStemNeg: opPreNeg,
952
+ stemPast: opPast,
953
+ postIdiomChainDepth: 0,
954
+ particleKind: op.particleKind,
955
+ focusParticle: op.focusParticle,
956
+ sourceTokens: op.source.tokens,
957
+ lookups: ctx.lookups,
958
+ sahenShortNegationSplit: ctx.sahenShortNegationSplit
959
+ });
960
+ if (!res.ok)
961
+ return res;
962
+ return withInputPrefix(inputBase, {
963
+ ...res,
964
+ chainOnFinalSupported: false,
965
+ finalNegationLoweringPolicy: "potential_idiom"
966
+ });
967
+ }
968
+ function modalOpBase(op, inputBase, ctx) {
969
+ const stemLemma = inputBase.final.lemma;
970
+ const stemIrregular = inputBase.final.irregular;
971
+ const isVerb = inputBase.final.isVerb;
972
+ const opPreNeg = ctx.preModalNeg;
973
+ const opPast = ctx.past;
974
+ const hostLowered = modalHostLoweringBase(op, inputBase, ctx);
975
+ if (hostLowered !== null)
976
+ return hostLowered;
977
+ const carrierLikeness = modalCarrierLikenessBase(op, inputBase, ctx);
978
+ if (carrierLikeness !== null)
979
+ return carrierLikeness;
980
+ const res = modalBase({
981
+ modal: op, stemLemma, stemIrregular,
982
+ stemKind: op.modal === "mai" ? (inputBase.final.isVerb ? "verb" : "adj") : (isVerb ? "verb" : "adj"),
983
+ preModalNeg: opPreNeg,
984
+ past: opPast,
985
+ pastProjection: ctx.pastProjection,
986
+ formal: ctx.formal,
987
+ ...(inputBase.policy === undefined ? {} : { inputPolicy: inputBase.policy }),
988
+ ...(ctx.sourceStemIsVerb === undefined ? {} : { sourceStemIsVerb: ctx.sourceStemIsVerb }),
989
+ sourceHostHasTeIruAspect: ctx.sourceHostHasTeIruAspect === true,
990
+ forbidShortNegation: ctx.forbidShortNegation,
991
+ preferShortLikenessNegation: ctx.preferShortLikenessNegation === true || opPreNeg !== null,
992
+ lookups: ctx.lookups,
993
+ sahenShortNegationSplit: ctx.sahenShortNegationSplit
994
+ });
995
+ if (!res.ok)
996
+ return res;
997
+ return withInputPrefix(inputBase, {
998
+ ...res,
999
+ ...modalFinalChainPolicy(res.base),
1000
+ interOpPastProjection: "committed"
1001
+ });
1002
+ }
1003
+ function modalHostLoweringBase(op, inputBase, ctx) {
1004
+ const opPreNeg = ctx.preModalNeg;
1005
+ const opPast = ctx.past;
1006
+ if (op.modal === "mai" &&
1007
+ (inputBase.policy?.kind === "noun_copula_interop" ||
1008
+ inputBase.policy?.kind === "negative_noun_copula_interop") &&
1009
+ opPreNeg === null &&
1010
+ !opPast) {
1011
+ const noun = inputBase.policy.nounSurface;
1012
+ const base = scopeCarrierCopulaBase("mai", "거", `${nounSubjectPart(noun, predicateBasePolicyAllomorphHost(inputBase))} 아닐 `);
1013
+ return {
1014
+ ok: true,
1015
+ base,
1016
+ ...modalFinalChainPolicy(base),
1017
+ interOpPastProjection: "committed"
1018
+ };
1019
+ }
1020
+ if (op.modal === "noda" &&
1021
+ inputBase.policy?.kind === "negative_noun_copula_interop" &&
1022
+ ctx.nextOp?.kind === "conjecture" &&
1023
+ opPreNeg === null &&
1024
+ !opPast) {
1025
+ return {
1026
+ ok: true,
1027
+ base: inputBase,
1028
+ chainOnFinalSupported: true
1029
+ };
1030
+ }
1031
+ if (op.modal === "tokoro") {
1032
+ const tokoroProjectedBase = tokoroBaseFromPredicateBase({
1033
+ modal: op,
1034
+ base: inputBase,
1035
+ preModalNeg: opPreNeg,
1036
+ past: opPast,
1037
+ formal: ctx.formal,
1038
+ pastProjection: ctx.pastProjection
1039
+ });
1040
+ if (tokoroProjectedBase !== null) {
1041
+ if (!tokoroProjectedBase.ok)
1042
+ return tokoroProjectedBase;
1043
+ return {
1044
+ ...tokoroProjectedBase,
1045
+ ...modalFinalChainPolicy(tokoroProjectedBase.base),
1053
1046
  interOpPastProjection: "committed"
1054
- });
1047
+ };
1055
1048
  }
1056
- case "conjecture": {
1057
- const copulaCarrierConjecture = opPreNeg === null
1058
- ? ((!opPast ? (nodaCarrierConjectureBase(inputBase, op) ?? wakeCarrierConjectureBase(inputBase, op)) : null) ??
1059
- copulaCarrierConjectureBase(inputBase, op, opPast))
1060
- : null;
1061
- if (copulaCarrierConjecture !== null) {
1062
- if (ctx.hasFollowingOp) {
1063
- if (ctx.nextOp?.kind === "predicateQuoteCarrier") {
1064
- return { ...copulaCarrierConjecture, chainOnFinalSupported: true };
1065
- }
1066
- return { ok: true, base: inputBase, chainOnFinalSupported: false };
1067
- }
1068
- return { ...copulaCarrierConjecture, chainOnFinalSupported: false };
1069
- }
1070
- const res = conjectureBase({
1071
- conjecture: op, stemLemma, stemIrregular, isVerb,
1072
- preModalNeg: opPreNeg, past: opPast,
1073
- shortNegationPolicy: ctx.shortNegationPolicy,
1074
- pastProjection: ctx.pastProjection
1075
- });
1076
- if (!res.ok)
1077
- return res;
1078
- const prefixed = withInputPrefix({ ...res, chainOnFinalSupported: false });
1079
- if (prefixed.ok &&
1080
- prefixed.base.policy?.kind === "negative_noun_copula_interop") {
1081
- return {
1082
- ...prefixed,
1083
- base: {
1084
- ...prefixed.base,
1085
- policy: { ...prefixed.base.policy, conjectureHostPast: opPast }
1086
- }
1087
- };
1049
+ }
1050
+ if (op.modal === "limit_negation") {
1051
+ const res = limitNegationBaseFromPredicateBase({
1052
+ modal: op,
1053
+ base: inputBase,
1054
+ preNeg: opPreNeg,
1055
+ past: opPast,
1056
+ formal: ctx.formal,
1057
+ lookups: ctx.lookups
1058
+ });
1059
+ if (!res.ok)
1060
+ return res;
1061
+ return { ...res, ...modalFinalChainPolicy(res.base), interOpPastProjection: "committed" };
1062
+ }
1063
+ if (op.modal === "mono" && (op.reading === "admirative" || op.reading === "habitual")) {
1064
+ const res = monoHostPredicateBase(op, inputBase, opPreNeg);
1065
+ if (!res.ok)
1066
+ return res;
1067
+ return { ...res, ...modalFinalChainPolicy(res.base), interOpPastProjection: "committed" };
1068
+ }
1069
+ if (op.modal === "souda_hearsay" && op.reading === "hearsay") {
1070
+ const res = soudaHearsayBaseFromPredicateBase(inputBase, opPreNeg, opPast, ctx.lookups, op);
1071
+ if (!res.ok)
1072
+ return res;
1073
+ return { ...res, ...modalFinalChainPolicy(res.base), interOpPastProjection: "committed" };
1074
+ }
1075
+ if (op.modal === "noda" && opPreNeg === null && !opPast) {
1076
+ const absorbed = nodaCarrierAbsorbedByHostBoundNoun(inputBase, op);
1077
+ if (absorbed !== null) {
1078
+ return { ...absorbed, ...modalFinalChainPolicy(absorbed.base), interOpPastProjection: "committed" };
1079
+ }
1080
+ }
1081
+ if (op.modal === "kamo" && opPreNeg === null) {
1082
+ const carrierKamo = nodaCarrierKamoBase(inputBase, ctx.formal, opPast, op.bare);
1083
+ if (carrierKamo !== null) {
1084
+ return {
1085
+ ...carrierKamo,
1086
+ ...modalFinalChainPolicy(carrierKamo.base),
1087
+ interOpPastProjection: "committed"
1088
+ };
1089
+ }
1090
+ }
1091
+ return null;
1092
+ }
1093
+ function modalCarrierLikenessBase(op, inputBase, ctx) {
1094
+ const opPreNeg = ctx.preModalNeg;
1095
+ const opPast = ctx.past;
1096
+ if (op.modal === "wake") {
1097
+ const wakeCitation = wakeExplanatoryCitationBase({
1098
+ op, inputBase, preStemNeg: opPreNeg, stemPast: opPast, formal: ctx.formal
1099
+ });
1100
+ if (wakeCitation !== null) {
1101
+ if (!wakeCitation.ok)
1102
+ return wakeCitation;
1103
+ return {
1104
+ ...wakeCitation,
1105
+ ...modalFinalChainPolicy(wakeCitation.base),
1106
+ interOpPastProjection: "committed"
1107
+ };
1108
+ }
1109
+ }
1110
+ if ((op.modal === "rashii" || op.modal === "youda") && opPreNeg === null && !opPast) {
1111
+ const carrierLikeness = nodaCarrierLikenessBase(inputBase);
1112
+ if (carrierLikeness !== null) {
1113
+ return {
1114
+ ...carrierLikeness,
1115
+ ...modalFinalChainPolicy(carrierLikeness.base),
1116
+ interOpPastProjection: "committed"
1117
+ };
1118
+ }
1119
+ const quotedLikeness = quotedPropositionLikenessBase(inputBase, op, ctx.formal, ctx.pastProjection);
1120
+ if (quotedLikeness !== null) {
1121
+ return {
1122
+ ...quotedLikeness,
1123
+ ...modalFinalChainPolicy(quotedLikeness.base),
1124
+ interOpPastProjection: "committed"
1125
+ };
1126
+ }
1127
+ }
1128
+ if (op.modal === "rashii" &&
1129
+ opPreNeg === null &&
1130
+ !opPast &&
1131
+ !ctx.hasPriorChainOp &&
1132
+ inputBase.policy?.kind === "noun_copula_interop" &&
1133
+ inputBase.policy.zeroCopula === true) {
1134
+ const res = nominalHostEvidentialLikenessBase(inputBase.policy.nounSurface, op);
1135
+ if (!res.ok)
1136
+ return res;
1137
+ return { ...res, ...modalFinalChainPolicy(res.base), interOpPastProjection: "committed" };
1138
+ }
1139
+ if (op.modal === "mai" && opPreNeg === null && !opPast) {
1140
+ const scopeMai = maiScopeCarrierBase(op, inputBase);
1141
+ if (scopeMai !== null) {
1142
+ if (!scopeMai.ok)
1143
+ return scopeMai;
1144
+ return { ...scopeMai, ...modalFinalChainPolicy(scopeMai.base) };
1145
+ }
1146
+ }
1147
+ return null;
1148
+ }
1149
+ function conjectureOpBase(op, inputBase, ctx) {
1150
+ const stemLemma = inputBase.final.lemma;
1151
+ const stemIrregular = inputBase.final.irregular;
1152
+ const isVerb = inputBase.final.isVerb;
1153
+ const opPreNeg = ctx.preModalNeg;
1154
+ const opPast = ctx.past;
1155
+ const copulaCarrierConjecture = opPreNeg === null
1156
+ ? ((!opPast ? (nodaCarrierConjectureBase(inputBase, op) ?? wakeCarrierConjectureBase(inputBase, op)) : null) ??
1157
+ copulaCarrierConjectureBase(inputBase, op, opPast))
1158
+ : null;
1159
+ if (copulaCarrierConjecture !== null) {
1160
+ if (ctx.hasFollowingOp) {
1161
+ if (ctx.nextOp?.kind === "predicateQuoteCarrier") {
1162
+ return { ...copulaCarrierConjecture, chainOnFinalSupported: true };
1088
1163
  }
1089
- return prefixed;
1164
+ return { ok: true, base: inputBase, chainOnFinalSupported: false };
1090
1165
  }
1091
- default:
1092
- return { ok: false, reason: `op kind not in chain dispatcher` };
1166
+ return { ...copulaCarrierConjecture, chainOnFinalSupported: false };
1167
+ }
1168
+ const res = conjectureBase({
1169
+ conjecture: op, stemLemma, stemIrregular, isVerb,
1170
+ preModalNeg: opPreNeg, past: opPast,
1171
+ shortNegationPolicy: ctx.shortNegationPolicy,
1172
+ pastProjection: ctx.pastProjection
1173
+ });
1174
+ if (!res.ok)
1175
+ return res;
1176
+ const prefixed = withInputPrefix(inputBase, { ...res, chainOnFinalSupported: false });
1177
+ if (prefixed.ok &&
1178
+ prefixed.base.policy?.kind === "negative_noun_copula_interop") {
1179
+ return {
1180
+ ...prefixed,
1181
+ base: {
1182
+ ...prefixed.base,
1183
+ policy: { ...prefixed.base.policy, conjectureHostPast: opPast }
1184
+ }
1185
+ };
1093
1186
  }
1187
+ return prefixed;
1094
1188
  }
1095
1189
  function reportingPassiveLabelBase(op, inputBase) {
1096
1190
  if (op.voice !== "passive" ||
@@ -1176,286 +1270,314 @@ export function chainBases(ops, stemLemma, stemIrregular, isVerb, ctx) {
1176
1270
  let activeFinalKind = initialTraceMatches
1177
1271
  ? initialTrace.finalKind
1178
1272
  : "lexeme";
1179
- const appendTracePrefix = (targetPrefix, sourceTokens, kind, projectionConfidence = "semantic") => {
1180
- if (!targetPrefix.startsWith(tracedPrefixText)) {
1181
- const contracted = tracePrefixContractionForTarget(tracePrefixSegments, targetPrefix);
1182
- if (contracted !== null) {
1183
- tracePrefixSegments.length = 0;
1184
- tracePrefixSegments.push(...contracted);
1185
- tracedPrefixText = tracePrefixSegments.map((segment) => segment.text).join("");
1186
- }
1187
- }
1188
- if (targetPrefix === tracedPrefixText) {
1189
- return;
1190
- }
1191
- if (tracedPrefixText.startsWith(targetPrefix)) {
1192
- return;
1193
- }
1194
- if (!targetPrefix.startsWith(tracedPrefixText)) {
1195
- tracedPrefixText = targetPrefix;
1196
- tracePrefixSegments.length = 0;
1197
- tracePrefixSegments.push({
1198
- text: targetPrefix,
1199
- sourceTokens,
1200
- kind,
1201
- projectionConfidence: "fallback"
1202
- });
1203
- return;
1273
+ const trace = { tracePrefixSegments, tracedPrefixText, activeFinalSourceTokens, activeFinalKind };
1274
+ const fold = {
1275
+ currentBase,
1276
+ currentPreNeg: ctx.preModalNeg,
1277
+ currentPast: ctx.stemPast,
1278
+ currentPastProjection: "lexical",
1279
+ pendingDesiredPredicateNegation: null,
1280
+ finalBase: null,
1281
+ lastChainOnFinalSupported: true,
1282
+ lastFinalNegationOptions: undefined,
1283
+ lastFinalNegationLoweringPolicy: undefined,
1284
+ lastTerminalPrefixContraction: undefined,
1285
+ lastTerminalRealization: undefined,
1286
+ lastConnectivePrefixContraction: undefined,
1287
+ pendingConnectivePrefixContraction: undefined,
1288
+ lastConnectiveBaseOverride: undefined,
1289
+ lastInterOpPastProjection: undefined,
1290
+ lastProjectsAsStativePerfect: false,
1291
+ currentSourceProjectionIsVerbalPredicate: (ctx.sourceStemIsVerb ?? isVerb) ||
1292
+ ctx.sourceStemIsSahenPredicate === true,
1293
+ preNegLoweredOnHostBase: new Set()
1294
+ };
1295
+ const initialNegationFailure = applyChainInitialPreNegation(fold, ops, ctx, initialBaseRes);
1296
+ if (initialNegationFailure !== null) {
1297
+ return initialNegationFailure;
1298
+ }
1299
+ for (let i = 0; i < ops.length; i++) {
1300
+ const opFailure = foldChainOp(fold, trace, ops, i, ctx, sahenShortNegationSplit);
1301
+ if (opFailure !== null) {
1302
+ return opFailure;
1204
1303
  }
1205
- const text = targetPrefix.slice(tracedPrefixText.length);
1206
- if (text.length > 0) {
1207
- tracePrefixSegments.push({ text, sourceTokens, kind, projectionConfidence });
1304
+ }
1305
+ const finalPastOp = ctx.pastAfterChainIdx.get(ops.length - 1) ?? null;
1306
+ const finalPast = finalPastOp !== null ||
1307
+ opCarriesIntrinsicPast(ops[ops.length - 1]) ||
1308
+ fold.lastProjectsAsStativePerfect;
1309
+ const finalNeg = ctx.negAfterChainIdx.get(ops.length - 1) ?? null;
1310
+ const finalTraceSourceTokens = [
1311
+ ...trace.activeFinalSourceTokens,
1312
+ ...(finalPastOp?.source.tokens ?? []),
1313
+ ...(finalNeg?.source.tokens ?? [])
1314
+ ];
1315
+ const result = {
1316
+ ok: true,
1317
+ base: fold.finalBase,
1318
+ finalPast,
1319
+ finalNeg,
1320
+ chainOnFinalSupported: fold.lastChainOnFinalSupported,
1321
+ chainSourceTrace: {
1322
+ prefixSegments: trace.tracePrefixSegments,
1323
+ finalSourceTokens: finalTraceSourceTokens,
1324
+ finalKind: trace.activeFinalKind
1208
1325
  }
1209
- tracedPrefixText = targetPrefix;
1210
1326
  };
1211
- const appendTraceSegment = (segment) => {
1212
- if (segment.text.length === 0) {
1213
- return;
1214
- }
1215
- tracePrefixSegments.push(segment);
1216
- tracedPrefixText += segment.text;
1327
+ return {
1328
+ ...result,
1329
+ ...(fold.lastFinalNegationOptions === undefined ? {} : { finalNegationOptions: fold.lastFinalNegationOptions }),
1330
+ ...(fold.lastFinalNegationLoweringPolicy === undefined ? {} : { finalNegationLoweringPolicy: fold.lastFinalNegationLoweringPolicy }),
1331
+ ...(fold.lastTerminalPrefixContraction === undefined ? {} : { terminalPrefixContraction: fold.lastTerminalPrefixContraction }),
1332
+ ...(fold.lastTerminalRealization === undefined ? {} : { terminalRealization: fold.lastTerminalRealization }),
1333
+ ...(fold.lastConnectivePrefixContraction === undefined ? {} : { connectivePrefixContraction: fold.lastConnectivePrefixContraction }),
1334
+ ...(fold.lastConnectiveBaseOverride === undefined ? {} : { connectiveBaseOverride: fold.lastConnectiveBaseOverride }),
1335
+ ...(fold.lastInterOpPastProjection === undefined ? {} : { finalPastProjection: fold.lastInterOpPastProjection })
1217
1336
  };
1218
- let currentPreNeg = ctx.preModalNeg;
1219
- let currentPast = ctx.stemPast;
1220
- let currentPastProjection = "lexical";
1221
- let pendingDesiredPredicateNegation = null;
1222
- if (currentPreNeg !== null && negationFeedsNaideHoshii(currentPreNeg, ops[0])) {
1223
- if (currentPreNeg.chainDepth !== 1 || currentPreNeg.chainPast) {
1337
+ }
1338
+ function appendChainTracePrefix(trace, targetPrefix, sourceTokens, kind, projectionConfidence = "semantic") {
1339
+ if (!targetPrefix.startsWith(trace.tracedPrefixText)) {
1340
+ const contracted = tracePrefixContractionForTarget(trace.tracePrefixSegments, targetPrefix);
1341
+ if (contracted !== null) {
1342
+ trace.tracePrefixSegments.length = 0;
1343
+ trace.tracePrefixSegments.push(...contracted);
1344
+ trace.tracedPrefixText = trace.tracePrefixSegments.map((segment) => segment.text).join("");
1345
+ }
1346
+ }
1347
+ if (targetPrefix === trace.tracedPrefixText) {
1348
+ return;
1349
+ }
1350
+ if (trace.tracedPrefixText.startsWith(targetPrefix)) {
1351
+ return;
1352
+ }
1353
+ if (!targetPrefix.startsWith(trace.tracedPrefixText)) {
1354
+ trace.tracedPrefixText = targetPrefix;
1355
+ trace.tracePrefixSegments.length = 0;
1356
+ trace.tracePrefixSegments.push({
1357
+ text: targetPrefix,
1358
+ sourceTokens,
1359
+ kind,
1360
+ projectionConfidence: "fallback"
1361
+ });
1362
+ return;
1363
+ }
1364
+ const text = targetPrefix.slice(trace.tracedPrefixText.length);
1365
+ if (text.length > 0) {
1366
+ trace.tracePrefixSegments.push({ text, sourceTokens, kind, projectionConfidence });
1367
+ }
1368
+ trace.tracedPrefixText = targetPrefix;
1369
+ }
1370
+ function appendChainTraceSegment(trace, segment) {
1371
+ if (segment.text.length === 0) {
1372
+ return;
1373
+ }
1374
+ trace.tracePrefixSegments.push(segment);
1375
+ trace.tracedPrefixText += segment.text;
1376
+ }
1377
+ function applyChainInitialPreNegation(fold, ops, ctx, initialBaseRes) {
1378
+ if (fold.currentPreNeg !== null && negationFeedsNaideHoshii(fold.currentPreNeg, ops[0])) {
1379
+ if (fold.currentPreNeg.chainDepth !== 1 || fold.currentPreNeg.chainPast) {
1224
1380
  return { ok: false, reason: "desired predicate negation before te_hoshii supports only single non-past negative" };
1225
1381
  }
1226
- pendingDesiredPredicateNegation = currentPreNeg;
1227
- currentPreNeg = null;
1382
+ fold.pendingDesiredPredicateNegation = fold.currentPreNeg;
1383
+ fold.currentPreNeg = null;
1228
1384
  }
1229
1385
  const firstOpOwnsPreNegation = ops[0]?.kind === "scopeBridge" &&
1230
1386
  (ops[0].head === "koto" || ops[0].head === "implicit");
1231
- if (currentPreNeg !== null &&
1387
+ if (fold.currentPreNeg !== null &&
1232
1388
  initialBaseRes.finalNegationLoweringPolicy !== undefined &&
1233
1389
  !firstOpOwnsPreNegation) {
1234
- const lowered = lowerFinalNegationForCommittedBase(initialBaseRes, currentPreNeg, ctx.formal, ctx.lookups);
1390
+ const lowered = lowerFinalNegationForCommittedBase(initialBaseRes, fold.currentPreNeg, ctx.formal, ctx.lookups);
1235
1391
  if (lowered === null) {
1236
1392
  return { ok: false, reason: "stem final negation lowering before op 영역 외" };
1237
1393
  }
1238
- currentBase = lowered;
1239
- const loweredForcesPast = finalNegationLoweringForcesPast(initialBaseRes, currentPreNeg.chainDepth);
1240
- currentPast = ctx.stemPast || currentPreNeg.chainPast || loweredForcesPast;
1241
- currentPastProjection = currentPast
1394
+ fold.currentBase = lowered;
1395
+ const loweredForcesPast = finalNegationLoweringForcesPast(initialBaseRes, fold.currentPreNeg.chainDepth);
1396
+ fold.currentPast = ctx.stemPast || fold.currentPreNeg.chainPast || loweredForcesPast;
1397
+ fold.currentPastProjection = fold.currentPast
1242
1398
  ? (ops[0]?.kind === "conjecture" ? "committed" : "lexical")
1243
1399
  : "lexical";
1244
- currentPreNeg = null;
1245
- }
1246
- let finalBase = null;
1247
- let lastChainOnFinalSupported = true;
1248
- let lastFinalNegationOptions;
1249
- let lastFinalNegationLoweringPolicy;
1250
- let lastTerminalPrefixContraction;
1251
- let lastTerminalRealization;
1252
- let lastConnectivePrefixContraction;
1253
- let pendingConnectivePrefixContraction;
1254
- let lastConnectiveBaseOverride;
1255
- let lastInterOpPastProjection;
1256
- let lastProjectsAsStativePerfect = false;
1257
- let currentSourceProjectionIsVerbalPredicate = (ctx.sourceStemIsVerb ?? isVerb) ||
1258
- ctx.sourceStemIsSahenPredicate === true;
1259
- const preNegLoweredOnHostBase = new Set();
1260
- for (let i = 0; i < ops.length; i++) {
1261
- const op = ops[i];
1262
- const isLast = i === ops.length - 1;
1263
- const ownedPreNeg = ctx.negBeforeChainIdx?.get(i) ?? null;
1264
- if (ownedPreNeg !== null && !preNegLoweredOnHostBase.has(ownedPreNeg)) {
1265
- if (currentPreNeg !== null) {
1266
- return { ok: false, reason: "multiple pre-reference NegationOps in same chain slot not supported" };
1267
- }
1268
- currentPreNeg = ownedPreNeg;
1400
+ fold.currentPreNeg = null;
1401
+ }
1402
+ return null;
1403
+ }
1404
+ function foldChainOp(fold, trace, ops, i, ctx, sahenShortNegationSplit) {
1405
+ const op = ops[i];
1406
+ const isLast = i === ops.length - 1;
1407
+ const ownedPreNeg = ctx.negBeforeChainIdx?.get(i) ?? null;
1408
+ if (ownedPreNeg !== null && !fold.preNegLoweredOnHostBase.has(ownedPreNeg)) {
1409
+ if (fold.currentPreNeg !== null) {
1410
+ return { ok: false, reason: "multiple pre-reference NegationOps in same chain slot not supported" };
1269
1411
  }
1270
- const negAfterCurrentOp = ctx.negAfterChainIdx.get(i) ?? null;
1271
- const desiredPredicateNegation = pendingDesiredPredicateNegation;
1272
- pendingDesiredPredicateNegation = null;
1273
- const previousOp = i > 0 ? ops[i - 1] : undefined;
1274
- const opCtx = {
1275
- lookups: ctx.lookups,
1276
- chainIndex: i,
1277
- hasPriorChainOp: i > 0,
1278
- sourceStemIsVerb: currentSourceProjectionIsVerbalPredicate,
1279
- sourceStemIsVolitional: i === 0 && ctx.sourceStemIsVolitional === true,
1280
- sourceHostHasTeIruAspect: previousOp?.kind === "aspect" && previousOp.aspect === "te_iru",
1281
- ...(ctx.sourceStemIsSahenPredicate === undefined
1282
- ? {}
1283
- : { sourceStemIsSahenPredicate: ctx.sourceStemIsSahenPredicate }),
1284
- ...(ctx.adverbialStemLemma === undefined ? {} : { adverbialStemLemma: ctx.adverbialStemLemma }),
1285
- preModalNeg: currentPreNeg,
1286
- past: currentPast,
1287
- pastProjection: currentPastProjection,
1288
- formal: ctx.formal,
1289
- hasFollowingOp: !isLast,
1290
- nextOp: ops[i + 1],
1291
- shortNegationPolicy: i === 0 ? ctx.shortNegationPolicy : undefined,
1292
- sahenShortNegationSplit,
1293
- ...(ctx.preferShortLikenessNegation === undefined
1294
- ? {}
1295
- : { preferShortLikenessNegation: ctx.preferShortLikenessNegation }),
1296
- passiveStemOptions: i === 0 ? ctx.passiveStemOptions : {},
1297
- forbidShortNegation: i > 0 && currentPreNeg !== null,
1298
- desiredPredicateNegation
1299
- };
1300
- const baseRes = opToBase(op, currentBase, opCtx);
1301
- if (!baseRes.ok)
1302
- return baseRes;
1303
- currentSourceProjectionIsVerbalPredicate = sourceVerbalPredicateAfterAuxOp(currentSourceProjectionIsVerbalPredicate, op);
1304
- const sourceTrace = sourceTraceWithFinalNegationStem(baseRes, negAfterCurrentOp);
1305
- if (sourceTrace !== undefined) {
1306
- const inputProjectionTargetPrefix = `${currentBase.prefix}${sourceTrace.inputProjectionText}`;
1307
- const inputProjectionSourceTokens = i === 0
1308
- ? [
1309
- ...activeFinalSourceTokens,
1310
- ...(currentPreNeg?.source.tokens ?? []),
1311
- ...(ctx.stemPastSourceTokens ?? []),
1312
- ...(sourceTrace.inputProjectionExtraSourceTokens ?? [])
1313
- ]
1314
- : [
1315
- ...activeFinalSourceTokens,
1316
- ...(currentPreNeg?.source.tokens ?? []),
1317
- ...(sourceTrace.inputProjectionExtraSourceTokens ?? [])
1318
- ];
1319
- const inputProjectionSegments = i === 0
1320
- ? splitInitialLongNegationInputProjection(sourceTrace.inputProjectionText, currentBase, activeFinalSourceTokens, currentPreNeg, ctx.stemPastSourceTokens, activeFinalKind)
1321
- : null;
1322
- const inputProjectionSegmentText = inputProjectionSegments
1323
- ?.map((segment) => segment.text)
1324
- .join("");
1325
- if (inputProjectionSegments !== null &&
1326
- inputProjectionTargetPrefix.startsWith(tracedPrefixText) &&
1327
- inputProjectionTargetPrefix.slice(tracedPrefixText.length) === inputProjectionSegmentText) {
1328
- for (const segment of inputProjectionSegments) {
1329
- appendTraceSegment(segment);
1330
- }
1331
- }
1332
- else {
1333
- appendTracePrefix(inputProjectionTargetPrefix, inputProjectionSourceTokens, activeFinalKind);
1334
- }
1335
- for (const segment of sourceTrace.carrierPrefixSegments) {
1336
- appendTraceSegment(segment);
1412
+ fold.currentPreNeg = ownedPreNeg;
1413
+ }
1414
+ const negAfterCurrentOp = ctx.negAfterChainIdx.get(i) ?? null;
1415
+ const desiredPredicateNegation = fold.pendingDesiredPredicateNegation;
1416
+ fold.pendingDesiredPredicateNegation = null;
1417
+ const previousOp = i > 0 ? ops[i - 1] : undefined;
1418
+ const opCtx = {
1419
+ lookups: ctx.lookups,
1420
+ chainIndex: i,
1421
+ hasPriorChainOp: i > 0,
1422
+ sourceStemIsVerb: fold.currentSourceProjectionIsVerbalPredicate,
1423
+ sourceStemIsVolitional: i === 0 && ctx.sourceStemIsVolitional === true,
1424
+ sourceHostHasTeIruAspect: previousOp?.kind === "aspect" && previousOp.aspect === "te_iru",
1425
+ ...(ctx.sourceStemIsSahenPredicate === undefined
1426
+ ? {}
1427
+ : { sourceStemIsSahenPredicate: ctx.sourceStemIsSahenPredicate }),
1428
+ ...(ctx.adverbialStemLemma === undefined ? {} : { adverbialStemLemma: ctx.adverbialStemLemma }),
1429
+ preModalNeg: fold.currentPreNeg,
1430
+ past: fold.currentPast,
1431
+ pastProjection: fold.currentPastProjection,
1432
+ formal: ctx.formal,
1433
+ hasFollowingOp: !isLast,
1434
+ nextOp: ops[i + 1],
1435
+ shortNegationPolicy: i === 0 ? ctx.shortNegationPolicy : undefined,
1436
+ sahenShortNegationSplit,
1437
+ ...(ctx.preferShortLikenessNegation === undefined
1438
+ ? {}
1439
+ : { preferShortLikenessNegation: ctx.preferShortLikenessNegation }),
1440
+ passiveStemOptions: i === 0 ? ctx.passiveStemOptions : {},
1441
+ forbidShortNegation: i > 0 && fold.currentPreNeg !== null,
1442
+ desiredPredicateNegation
1443
+ };
1444
+ const baseRes = opToBase(op, fold.currentBase, opCtx);
1445
+ if (!baseRes.ok)
1446
+ return baseRes;
1447
+ fold.currentSourceProjectionIsVerbalPredicate = sourceVerbalPredicateAfterAuxOp(fold.currentSourceProjectionIsVerbalPredicate, op);
1448
+ const sourceTrace = sourceTraceWithFinalNegationStem(baseRes, negAfterCurrentOp);
1449
+ appendChainOpSourceTrace(fold, trace, op, i, ctx, baseRes, sourceTrace);
1450
+ if (isLast) {
1451
+ fold.finalBase = baseRes.base;
1452
+ fold.lastChainOnFinalSupported = baseRes.chainOnFinalSupported ?? true;
1453
+ fold.lastFinalNegationOptions = baseRes.finalNegationOptions;
1454
+ fold.lastFinalNegationLoweringPolicy = baseRes.finalNegationLoweringPolicy;
1455
+ fold.lastTerminalPrefixContraction = baseRes.terminalPrefixContraction;
1456
+ fold.lastTerminalRealization = baseRes.terminalRealization;
1457
+ fold.lastConnectivePrefixContraction = baseRes.connectivePrefixContraction ?? fold.pendingConnectivePrefixContraction;
1458
+ fold.lastConnectiveBaseOverride = baseRes.connectiveBaseOverride;
1459
+ fold.lastInterOpPastProjection = finalAttributivePastProjectionForChainOp(op, baseRes, ctx.pastAfterChainIdx.has(i) || opCarriesIntrinsicPast(op));
1460
+ fold.lastProjectsAsStativePerfect = baseRes.interOpProjectionPolicy === "stative_perfect";
1461
+ }
1462
+ else {
1463
+ const carryFailure = carryChainBaseToNextOp(fold, trace, ops, op, i, ctx, baseRes);
1464
+ if (carryFailure !== null) {
1465
+ return carryFailure;
1466
+ }
1467
+ }
1468
+ return null;
1469
+ }
1470
+ function appendChainOpSourceTrace(fold, trace, op, i, ctx, baseRes, sourceTrace) {
1471
+ if (sourceTrace !== undefined) {
1472
+ const inputProjectionTargetPrefix = `${fold.currentBase.prefix}${sourceTrace.inputProjectionText}`;
1473
+ const inputProjectionSourceTokens = i === 0
1474
+ ? [
1475
+ ...trace.activeFinalSourceTokens,
1476
+ ...(fold.currentPreNeg?.source.tokens ?? []),
1477
+ ...(ctx.stemPastSourceTokens ?? []),
1478
+ ...(sourceTrace.inputProjectionExtraSourceTokens ?? [])
1479
+ ]
1480
+ : [
1481
+ ...trace.activeFinalSourceTokens,
1482
+ ...(fold.currentPreNeg?.source.tokens ?? []),
1483
+ ...(sourceTrace.inputProjectionExtraSourceTokens ?? [])
1484
+ ];
1485
+ const inputProjectionSegments = i === 0
1486
+ ? splitInitialLongNegationInputProjection(sourceTrace.inputProjectionText, fold.currentBase, trace.activeFinalSourceTokens, fold.currentPreNeg, ctx.stemPastSourceTokens, trace.activeFinalKind)
1487
+ : null;
1488
+ const inputProjectionSegmentText = inputProjectionSegments
1489
+ ?.map((segment) => segment.text)
1490
+ .join("");
1491
+ if (inputProjectionSegments !== null &&
1492
+ inputProjectionTargetPrefix.startsWith(trace.tracedPrefixText) &&
1493
+ inputProjectionTargetPrefix.slice(trace.tracedPrefixText.length) === inputProjectionSegmentText) {
1494
+ for (const segment of inputProjectionSegments) {
1495
+ appendChainTraceSegment(trace, segment);
1337
1496
  }
1338
- appendTracePrefix(baseRes.base.prefix, sourceTrace.finalSourceTokens, sourceTrace.finalKind ?? "modal");
1339
- activeFinalSourceTokens = sourceTrace.finalSourceTokens;
1340
- activeFinalKind = sourceTrace.finalKind ?? "modal";
1341
1497
  }
1342
1498
  else {
1343
- const genericSourceTokens = [...activeFinalSourceTokens, ...op.source.tokens];
1344
- appendTracePrefix(baseRes.base.prefix, genericSourceTokens, op.kind === "aspect" ? "aux" : "modal");
1345
- activeFinalSourceTokens = genericSourceTokens;
1346
- activeFinalKind = op.kind === "aspect" ? "aux" : "modal";
1499
+ appendChainTracePrefix(trace, inputProjectionTargetPrefix, inputProjectionSourceTokens, trace.activeFinalKind);
1500
+ }
1501
+ for (const segment of sourceTrace.carrierPrefixSegments) {
1502
+ appendChainTraceSegment(trace, segment);
1347
1503
  }
1348
- if (isLast) {
1349
- finalBase = baseRes.base;
1350
- lastChainOnFinalSupported = baseRes.chainOnFinalSupported ?? true;
1351
- lastFinalNegationOptions = baseRes.finalNegationOptions;
1352
- lastFinalNegationLoweringPolicy = baseRes.finalNegationLoweringPolicy;
1353
- lastTerminalPrefixContraction = baseRes.terminalPrefixContraction;
1354
- lastTerminalRealization = baseRes.terminalRealization;
1355
- lastConnectivePrefixContraction = baseRes.connectivePrefixContraction ?? pendingConnectivePrefixContraction;
1356
- lastConnectiveBaseOverride = baseRes.connectiveBaseOverride;
1357
- lastInterOpPastProjection = finalAttributivePastProjectionForChainOp(op, baseRes, ctx.pastAfterChainIdx.has(i) || opCarriesIntrinsicPast(op));
1358
- lastProjectsAsStativePerfect = baseRes.interOpProjectionPolicy === "stative_perfect";
1504
+ appendChainTracePrefix(trace, baseRes.base.prefix, sourceTrace.finalSourceTokens, sourceTrace.finalKind ?? "modal");
1505
+ trace.activeFinalSourceTokens = sourceTrace.finalSourceTokens;
1506
+ trace.activeFinalKind = sourceTrace.finalKind ?? "modal";
1507
+ }
1508
+ else {
1509
+ const genericSourceTokens = [...trace.activeFinalSourceTokens, ...op.source.tokens];
1510
+ appendChainTracePrefix(trace, baseRes.base.prefix, genericSourceTokens, op.kind === "aspect" ? "aux" : "modal");
1511
+ trace.activeFinalSourceTokens = genericSourceTokens;
1512
+ trace.activeFinalKind = op.kind === "aspect" ? "aux" : "modal";
1513
+ }
1514
+ }
1515
+ function carryChainBaseToNextOp(fold, trace, ops, op, i, ctx, baseRes) {
1516
+ const admittedPreNegOfNextOp = baseRes.finalNegationLoweringPolicy !== undefined &&
1517
+ !operatorChainOpConsumesPrecedingNegation(ops[i + 1])
1518
+ ? ctx.negBeforeChainIdx?.get(i + 1) ?? null
1519
+ : null;
1520
+ const negCarry = ctx.negAfterChainIdx.get(i) ?? admittedPreNegOfNextOp;
1521
+ if (admittedPreNegOfNextOp !== null && negCarry === admittedPreNegOfNextOp) {
1522
+ fold.preNegLoweredOnHostBase.add(admittedPreNegOfNextOp);
1523
+ }
1524
+ fold.pendingConnectivePrefixContraction =
1525
+ baseRes.connectivePrefixContraction ?? fold.pendingConnectivePrefixContraction;
1526
+ if (negCarry !== null) {
1527
+ if (negationFeedsNaideHoshii(negCarry, ops[i + 1])) {
1528
+ if (negCarry.chainDepth !== 1 || negCarry.chainPast) {
1529
+ return { ok: false, reason: "desired predicate negation before te_hoshii supports only single non-past negative" };
1530
+ }
1531
+ const interOpBase = copulaCarrierBaseForInterOp(baseRes.base, ctx.formal);
1532
+ if (interOpBase === null) {
1533
+ return { ok: false, reason: "desired predicate negation base projection 영역 외" };
1534
+ }
1535
+ fold.currentBase = applyNonLastPrefixContractions(interOpBase, baseRes, ctx.formal);
1536
+ appendChainTracePrefix(trace, fold.currentBase.prefix, trace.activeFinalSourceTokens, trace.activeFinalKind);
1537
+ fold.pendingDesiredPredicateNegation = negCarry;
1359
1538
  }
1360
1539
  else {
1361
- const admittedPreNegOfNextOp = baseRes.finalNegationLoweringPolicy !== undefined &&
1362
- !operatorChainOpConsumesPrecedingNegation(ops[i + 1])
1363
- ? ctx.negBeforeChainIdx?.get(i + 1) ?? null
1364
- : null;
1365
- const negCarry = ctx.negAfterChainIdx.get(i) ?? admittedPreNegOfNextOp;
1366
- if (admittedPreNegOfNextOp !== null && negCarry === admittedPreNegOfNextOp) {
1367
- preNegLoweredOnHostBase.add(admittedPreNegOfNextOp);
1368
- }
1369
- pendingConnectivePrefixContraction =
1370
- baseRes.connectivePrefixContraction ?? pendingConnectivePrefixContraction;
1371
- if (negCarry !== null) {
1372
- if (negationFeedsNaideHoshii(negCarry, ops[i + 1])) {
1373
- if (negCarry.chainDepth !== 1 || negCarry.chainPast) {
1374
- return { ok: false, reason: "desired predicate negation before te_hoshii supports only single non-past negative" };
1375
- }
1376
- const interOpBase = copulaCarrierBaseForInterOp(baseRes.base, ctx.formal);
1377
- if (interOpBase === null) {
1378
- return { ok: false, reason: "desired predicate negation base projection 영역 외" };
1379
- }
1380
- currentBase = applyNonLastPrefixContractions(interOpBase, baseRes, ctx.formal);
1381
- appendTracePrefix(currentBase.prefix, activeFinalSourceTokens, activeFinalKind);
1382
- pendingDesiredPredicateNegation = negCarry;
1383
- }
1384
- else {
1385
- const lowered = lowerFinalNegationForCommittedBase(baseRes, negCarry, ctx.formal, ctx.lookups);
1386
- if (lowered === null) {
1387
- return { ok: false, reason: "chain mid final negation lowering 영역 외" };
1388
- }
1389
- currentBase = applyNonLastPrefixContractions(lowered, baseRes, ctx.formal);
1390
- activeFinalSourceTokens = [...activeFinalSourceTokens, ...negCarry.source.tokens];
1391
- activeFinalKind = "aux";
1392
- appendTracePrefix(currentBase.prefix, activeFinalSourceTokens, activeFinalKind);
1393
- }
1394
- currentPreNeg = null;
1395
- }
1396
- else {
1397
- const interOpBase = copulaCarrierBaseForInterOp(baseRes.base, ctx.formal);
1398
- if (interOpBase === null) {
1399
- return { ok: false, reason: "chain 중간 predicate base projection 영역 외" };
1400
- }
1401
- currentBase = applyNonLastPrefixContractions(interOpBase, baseRes, ctx.formal);
1402
- appendTracePrefix(currentBase.prefix, activeFinalSourceTokens, activeFinalKind);
1403
- currentPreNeg = null;
1404
- }
1405
- const projectsAsStativePerfect = baseRes.interOpProjectionPolicy === "stative_perfect";
1406
- const intrinsicPast = opCarriesIntrinsicPast(op);
1407
- const postOpTense = ctx.pastAfterChainIdx.get(i) ?? null;
1408
- const loweredForcesPast = negCarry === null
1409
- ? false
1410
- : finalNegationLoweringForcesPast(baseRes, negCarry.chainDepth);
1411
- currentPast = postOpTense !== null ||
1412
- (negCarry?.chainPast ?? false) ||
1413
- loweredForcesPast ||
1414
- intrinsicPast ||
1415
- projectsAsStativePerfect;
1416
- if (postOpTense !== null) {
1417
- activeFinalSourceTokens = [
1418
- ...activeFinalSourceTokens,
1419
- ...postOpTense.source.tokens
1420
- ];
1421
- }
1422
- currentPastProjection = currentPast
1423
- ? (ops[i + 1]?.kind === "conjecture" ? "committed" : (baseRes.interOpPastProjection ?? "lexical"))
1424
- : "lexical";
1540
+ const lowered = lowerFinalNegationForCommittedBase(baseRes, negCarry, ctx.formal, ctx.lookups);
1541
+ if (lowered === null) {
1542
+ return { ok: false, reason: "chain mid final negation lowering 영역 외" };
1543
+ }
1544
+ fold.currentBase = applyNonLastPrefixContractions(lowered, baseRes, ctx.formal);
1545
+ trace.activeFinalSourceTokens = [...trace.activeFinalSourceTokens, ...negCarry.source.tokens];
1546
+ trace.activeFinalKind = "aux";
1547
+ appendChainTracePrefix(trace, fold.currentBase.prefix, trace.activeFinalSourceTokens, trace.activeFinalKind);
1425
1548
  }
1549
+ fold.currentPreNeg = null;
1426
1550
  }
1427
- const finalPastOp = ctx.pastAfterChainIdx.get(ops.length - 1) ?? null;
1428
- const finalPast = finalPastOp !== null ||
1429
- opCarriesIntrinsicPast(ops[ops.length - 1]) ||
1430
- lastProjectsAsStativePerfect;
1431
- const finalNeg = ctx.negAfterChainIdx.get(ops.length - 1) ?? null;
1432
- const finalTraceSourceTokens = [
1433
- ...activeFinalSourceTokens,
1434
- ...(finalPastOp?.source.tokens ?? []),
1435
- ...(finalNeg?.source.tokens ?? [])
1436
- ];
1437
- const result = {
1438
- ok: true,
1439
- base: finalBase,
1440
- finalPast,
1441
- finalNeg,
1442
- chainOnFinalSupported: lastChainOnFinalSupported,
1443
- chainSourceTrace: {
1444
- prefixSegments: tracePrefixSegments,
1445
- finalSourceTokens: finalTraceSourceTokens,
1446
- finalKind: activeFinalKind
1551
+ else {
1552
+ const interOpBase = copulaCarrierBaseForInterOp(baseRes.base, ctx.formal);
1553
+ if (interOpBase === null) {
1554
+ return { ok: false, reason: "chain 중간 predicate base projection 영역 외" };
1447
1555
  }
1448
- };
1449
- return {
1450
- ...result,
1451
- ...(lastFinalNegationOptions === undefined ? {} : { finalNegationOptions: lastFinalNegationOptions }),
1452
- ...(lastFinalNegationLoweringPolicy === undefined ? {} : { finalNegationLoweringPolicy: lastFinalNegationLoweringPolicy }),
1453
- ...(lastTerminalPrefixContraction === undefined ? {} : { terminalPrefixContraction: lastTerminalPrefixContraction }),
1454
- ...(lastTerminalRealization === undefined ? {} : { terminalRealization: lastTerminalRealization }),
1455
- ...(lastConnectivePrefixContraction === undefined ? {} : { connectivePrefixContraction: lastConnectivePrefixContraction }),
1456
- ...(lastConnectiveBaseOverride === undefined ? {} : { connectiveBaseOverride: lastConnectiveBaseOverride }),
1457
- ...(lastInterOpPastProjection === undefined ? {} : { finalPastProjection: lastInterOpPastProjection })
1458
- };
1556
+ fold.currentBase = applyNonLastPrefixContractions(interOpBase, baseRes, ctx.formal);
1557
+ appendChainTracePrefix(trace, fold.currentBase.prefix, trace.activeFinalSourceTokens, trace.activeFinalKind);
1558
+ fold.currentPreNeg = null;
1559
+ }
1560
+ const projectsAsStativePerfect = baseRes.interOpProjectionPolicy === "stative_perfect";
1561
+ const intrinsicPast = opCarriesIntrinsicPast(op);
1562
+ const postOpTense = ctx.pastAfterChainIdx.get(i) ?? null;
1563
+ const loweredForcesPast = negCarry === null
1564
+ ? false
1565
+ : finalNegationLoweringForcesPast(baseRes, negCarry.chainDepth);
1566
+ fold.currentPast = postOpTense !== null ||
1567
+ (negCarry?.chainPast ?? false) ||
1568
+ loweredForcesPast ||
1569
+ intrinsicPast ||
1570
+ projectsAsStativePerfect;
1571
+ if (postOpTense !== null) {
1572
+ trace.activeFinalSourceTokens = [
1573
+ ...trace.activeFinalSourceTokens,
1574
+ ...postOpTense.source.tokens
1575
+ ];
1576
+ }
1577
+ fold.currentPastProjection = fold.currentPast
1578
+ ? (ops[i + 1]?.kind === "conjecture" ? "committed" : (baseRes.interOpPastProjection ?? "lexical"))
1579
+ : "lexical";
1580
+ return null;
1459
1581
  }
1460
1582
  function absorbedPassivePolicy(ctx, stemLemma) {
1461
1583
  const passiveClass = ctx.absorbedPassiveClass ?? absorbedPassiveClassFromMaterializedLemma(stemLemma);