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
@@ -1,104 +1,25 @@
1
- import { composeCommittedTailDiscursiveSfp, composePlainSelfQuestionTerminal, composeTerminalMoodOnBase } from "./sfp-question.js";
1
+ import { composeTerminalMoodOnBase } from "./sfp-question.js";
2
2
  import { quoteProjectionForSfpEffect } from "../../../../semantics/sfp-quote-projection.js";
3
3
  import { nounCopulaConnective, shortNegationPrefix } from "../../../../../generator/aux-map.js";
4
4
  import { conjugate } from "../../../../../generator/conjugator.js";
5
- import {} from "../../../../../types/token.js";
6
- import { POS4, POS5A, 仮定形_, 助動詞_ダ, isPastAuxConditionalForm } from "../../../../../types/pos.js";
7
- import { canonicalMedialProlongationConnectiveSurface, isNiSeriesConcessiveConditionalSurface } from "../connective-surface-table.js";
8
- import { isQuestionContentConnective } from "../bare-noun-stem-hosting.js";
9
- export { isQuestionContentConnective };
5
+ import { isNiSeriesConcessiveConditionalSurface } from "../connective-surface-table.js";
10
6
  import { addCoda, hasBatchim, hasNoCoda } from "../../../../../generator/hangul.js";
11
7
  import { hasAllomorphBatchim, nounPastCopulaStem, selectParticle } from "../../../../../generator/particles.js";
12
8
  import {} from "../../../../lookup-tables.js";
13
- import { normalizeGiveRequest, normalizeRequestQuotative, normalizeRequestQuoteNominal, requestQuoteAttributiveRecipe } from "../../../../rendering/request-normalization.js";
14
9
  import { CONNECTIVE_RENDER_MAP, isAdversativeConnectiveSurface } from "../connective-render-table.js";
15
10
  import { quotedMoodForClosingSfpEffect, DEFAULT_RENYOU_CHUUSHI_ROLE, DEFAULT_TE_FORM_ROLE, RENYOU_CHUUSHI_SYNTHETIC_TE_SURFACE } from "../grammar.js";
16
- import { likenessAttributiveLexicalizationBase, isFutureAttributiveProjection, applyNegationChainToLemmaBase, closeChainTraceAgainstText, closeChainTraceWithConnectivePieces, closeChainTraceWithFinalConnectiveAgainstTerminal, concatPredicatePrefix, rebindChainFinalPlaceholders, rebindChainTraceForProjection, tracedCat, tracedChainFinalPlaceholder, tracedSeg, nounCopulaFinalAllomorphHost, nounCopulaRealizedAllomorphHost, predicateBasePolicyAllomorphHost, baseResultWithNegationFocus, negationLoweringOptionsWithOpFocus } from "./base-model.js";
17
- import { applyConnectivePrefixContraction, applyExternalNegationDepthToPredicateBase, applyTerminalPrefixContraction, completionPotentialCompletedBase, conjectureBaseSourceTrace, finalNegationLoweringForcesPast, isBenefactiveNegativeCarrierPolicy, lexicalPotentialStemBase, lowerBaseForPredicateProjection, lowerBaseKeepingFinal, lowerFinalNegationDepthForCommittedBase, lowerFinalNegationForCommittedBase, lowerPotentialFinalNegationBase, copularLemmaOfBase, negativeNounCopulaChainBase, nounCopulaBaseForCopula, predicateBaseInfinitiveForm, quotePlainDeclarative } from "./base-support.js";
18
- import { composeAniForm, composeDoublePastFinalForm, composeFinalForm, conjectureFinalForm, nounToCopulaForm, obligationEmphasis, renderBaseVolitionalTerminal } from "./final-forms.js";
19
- import { renderPredicateBaseVolitionalCohortativeAttributive, renderPredicateBaseVolitionalDeliberativeRetrospective, renderPredicateBaseVolitionalIntentAttributive, renderPredicateBaseVolitionalPurposeConnective, renderPredicateBaseVolitionalQuotative } from "./final-forms.js";
11
+ import { applyNegationChainToLemmaBase, closeChainTraceAgainstText, closeChainTraceWithConnectivePieces, closeChainTraceWithFinalConnectiveAgainstTerminal, concatPredicatePrefix, rebindChainFinalPlaceholders, rebindChainTraceForProjection, tracedCat, tracedChainFinalPlaceholder, tracedSeg, nounCopulaFinalAllomorphHost, baseResultWithNegationFocus } from "./base-model.js";
12
+ import { applyConnectivePrefixContraction, applyExternalNegationDepthToPredicateBase, applyTerminalPrefixContraction, completionPotentialCompletedBase, finalNegationLoweringForcesPast, lowerBaseForPredicateProjection, lowerBaseKeepingFinal, lowerFinalNegationForCommittedBase, negativeNounCopulaChainBase, nounCopulaBaseForCopula, predicateBaseInfinitiveForm } from "./base-support.js";
13
+ import { nounToCopulaForm, obligationEmphasis, renderBaseVolitionalTerminal } from "./final-forms.js";
20
14
  import { loadTailAttachmentRegistry, nominalFrameDataGeneration } from "../../../head/adapters/nominal/frame-table.js";
21
15
  import { boundNominalReasonQuoteCarrierAt } from "../matchers/bound-nominal-connective.js";
22
- import { predicateMoodRequestsFutureProjection } from "../attributive-head-policy.js";
23
- import { isHeadOp } from "../operator-head.js";
24
16
  import { createConnectiveOp } from "../op-builders.js";
25
- export function attributiveBoundaryRequestsFutureProjection(layer) {
26
- if (predicateMoodRequestsFutureProjection(layer)) {
27
- return true;
28
- }
29
- const obligationIdx = layer.ops.findIndex((op) => op.kind === "idiom" &&
30
- op.idiom === "obligation" &&
31
- op.variant === "beki" &&
32
- op.polarity === "affirmative");
33
- if (obligationIdx >= 0 && !layer.ops.slice(obligationIdx + 1).some(isHeadOp)) {
34
- return true;
35
- }
36
- return layer.terminalPayload?.kind === "attributiveBoundary" &&
37
- (layer.terminalPayload.headKind === "future_commitment" ||
38
- layer.terminalPayload.headRequestsFutureProjection === true) &&
39
- layer.terminalPayload.projection === "ordinary_nominal";
40
- }
41
- function copularQuoteOption(base) {
42
- const lemma = copularLemmaOfBase(base);
43
- return lemma === undefined ? {} : { copularLemma: lemma };
44
- }
45
- export function composeBaseWithConjectureQuestionConnective(base, connective, past, formal, polite) {
46
- if (!isConjectureQuestionContinuationConnective(connective)) {
47
- return { ok: false, reason: "conjecture question connective requires question-content connective" };
48
- }
49
- const questionPolite = polite ||
50
- (connective.questionContentRole === "terminal" &&
51
- base.final.kind === "lemma" &&
52
- base.final.idiom?.kind === "conjecture" &&
53
- base.final.idiom.conjecturePolite === true);
54
- let question = null;
55
- if (base.final.kind === "lemma" && base.final.idiom?.kind === "conjecture") {
56
- const nominalized = base.final.idiom.projection === "nominalized"
57
- ? nominalizedConjectureStem(base.final.lemma)
58
- : null;
59
- if (nominalized !== null) {
60
- question = `${base.prefix}${nominalized}일까${questionPolite ? "요" : ""}`;
61
- }
62
- else if (base.policy?.kind === "noun_copula_interop") {
63
- question = composeNounCopulaConjectureQuestion({
64
- prefix: "",
65
- final: {
66
- kind: "nounCopula",
67
- nounSurface: base.policy.nounSurface,
68
- isBoundNoun: base.policy.isBoundNoun
69
- }
70
- }, past || base.policy.conjectureHostPast === true, formal, questionPolite);
71
- }
72
- else if (base.policy?.kind === "negative_noun_copula_interop") {
73
- const attr = past || base.policy.conjectureHostPast === true ? "아니었을" : "아닐";
74
- question = `${base.policy.conjectureSubject}${attr}까${questionPolite ? "요" : ""}`;
75
- }
76
- else if (base.final.idiom.sourceLemma !== undefined) {
77
- const sourceLemma = base.final.idiom.sourceLemma;
78
- const sourceIrregular = base.final.idiom.sourceIrregular ?? null;
79
- const lemmaQuestion = base.final.idiom.sourceNegation === "long"
80
- ? `${base.final.idiom.sourceNegationInability === true ? "못할까" : "않을까"}${questionPolite ? "요" : ""}`
81
- : past
82
- ? `${conjugate(sourceLemma, sourceIrregular, "았/었")}을까${questionPolite ? "요" : ""}`
83
- : `${conjugate(sourceLemma, sourceIrregular, "ㄹ/을까")}${questionPolite ? "요" : ""}`;
84
- question = `${base.prefix}${lemmaQuestion}`;
85
- }
86
- }
87
- else if (base.final.kind === "nounCopula" || base.final.kind === "negativeNounCopula") {
88
- question = composeNounCopulaConjectureQuestion(base, past, formal, questionPolite);
89
- }
90
- else if (base.final.kind === "lemma") {
91
- const lemmaQuestion = past
92
- ? `${conjugate(base.final.lemma, base.final.irregular, "았/었")}을까${questionPolite ? "요" : ""}`
93
- : `${conjugate(base.final.lemma, base.final.irregular, "ㄹ/을까")}${questionPolite ? "요" : ""}`;
94
- question = `${base.prefix}${lemmaQuestion}`;
95
- }
96
- if (question === null) {
97
- return { ok: false, reason: "conjecture question connective on non-projectable base not supported" };
98
- }
99
- const suffix = connective.connective === "question_quotative" ? " 하고" : "";
100
- return { ok: true, text: `${question}${suffix}`, polite: questionPolite };
101
- }
17
+ import { projectBaseFutureAttributive, projectBaseAttributive, projectBaseMNominalized, projectBaseReasonGerund, plainDeclarativeToPointAttributive, projectBaseNominalized } from "./predicate-base-projection.js";
18
+ import { composeBaseWithImperativeQuotative, composeBaseWithPredicateProjectionQuoteAttributive, connectiveFocusParticleSuffix, composeBaseWithQuotative, applyQuoteBoundaryFocus, composeBaseWithCognitiveComplement, composeBaseWithRequestComplement, composeRequestProhibitionComplement, composeRequestProhibitionAttributiveQuote, composeBaseWithReformulation, composeBaseWithRetrospectiveQuotative, composeBaseWithQuestionReformulation, composeBaseWithWishComplement } from "./quote-complement-compose.js";
19
+ import { composeNominalizedConjectureConnective } from "./conjecture-compose.js";
20
+ import { composeBaseWithTerminalChain, attachCommittedChainTrace, composeCommittedTailTerminal } from "./predicate-terminal-compose.js";
21
+ import { composeBaseWithYouNiPurpose, composeBaseWithNiwaIntentionalPurpose, composeBaseWithPurposeMotion, composeBaseWithYouNiMannerSimile, composeBaseWithYouNiMannerVolitional, appearanceAdverbialLexicalizationApplies, composeBaseWithYouNiMannerSimileAction } from "./purpose-manner-compose.js";
22
+ import { resolveConnectiveEnding, connectiveRenderSurface } from "./connective-ending.js";
102
23
  function composeNounCopulaNegativeToObligation(noun, formal, polite, lookups, allomorphHost) {
103
24
  const obligationBase = nounCopulaObligationBase(noun, allomorphHost);
104
25
  const terminal = composeBaseWithTerminalChain(obligationBase, null, false, formal, polite, lookups);
@@ -139,106 +60,6 @@ export function composeBaseWithBareProhibition(base) {
139
60
  polite: false
140
61
  };
141
62
  }
142
- export function composeBaseWithSequenceAfterCompactQuoteAttributive(base, connective, past, preNeg, formal, lookups) {
143
- if (connective.connective !== "sequence_after") {
144
- return { ok: false, reason: "compact quote attributive requires sequence_after connective" };
145
- }
146
- const sequence = composeBaseWithConnective(base, connective, past, false, preNeg, formal, lookups);
147
- if (!sequence.ok)
148
- return sequence;
149
- return {
150
- ok: true,
151
- text: `${sequence.text}${selectParticle(sequence.text, "이라는/라는")}`,
152
- polite: false
153
- };
154
- }
155
- export function composeCommittedSequenceAfterCompactQuoteAttributive(baseResult, connective, past, finalNeg, formal, lookups, options = {}) {
156
- if (connective.connective !== "sequence_after" &&
157
- connective.connective !== "exemplification" &&
158
- !(connective.connective === "conditional" &&
159
- (options.likenessAfterCarrier !== undefined ||
160
- options.wishMannerAfterCarrier === true ||
161
- options.directMannerAfterCarrier === true ||
162
- options.conditionalEllipsisMoodAfterCarrier !== undefined)) &&
163
- !(connective.connective === "reason" && options.reasonAfterCarrier === true)) {
164
- return { ok: false, reason: "committed compact quote attributive requires a projectable connective" };
165
- }
166
- if (connective.connective === "reason" && options.reasonAfterCarrier === true) {
167
- if (!baseResult.ok)
168
- return baseResult;
169
- const loweredBase = lowerBaseKeepingFinal(baseResult.base, finalNeg, formal, {});
170
- if (loweredBase === null) {
171
- return { ok: false, reason: "reason quote carrier negation lowering not supported" };
172
- }
173
- const gerund = projectBaseReasonGerund(loweredBase, past || (finalNeg?.chainPast ?? false), formal);
174
- if (gerund === null) {
175
- return { ok: false, reason: "reason quote carrier gerund projection not supported" };
176
- }
177
- const reasonRequiresFuture = options.attrPolicy !== undefined &&
178
- isFutureAttributiveProjection(options.attrPolicy);
179
- return {
180
- ok: true,
181
- text: `${gerund} ${reasonRequiresFuture ? "때문이라고 할" : "때문이라는"}`,
182
- polite: false
183
- };
184
- }
185
- const sequence = composeCommittedTailConnective(baseResult, connective, past, false, finalNeg, formal, lookups);
186
- if (!sequence.ok)
187
- return sequence;
188
- const requiresFuture = options.attrPolicy !== undefined && isFutureAttributiveProjection(options.attrPolicy);
189
- if (connective.connective === "conditional") {
190
- if (options.wishMannerAfterCarrier === true) {
191
- return {
192
- ...sequence,
193
- text: requiresFuture
194
- ? `${sequence.text} ${conjugate("좋겠다", null, "ㄹ/을")}`
195
- : `${sequence.text} ${plainDeclarativeToPointAttributive("좋겠다")}`,
196
- polite: false
197
- };
198
- }
199
- if (options.conditionalEllipsisMoodAfterCarrier !== undefined) {
200
- return composeConditionalQuoteEllipsisAttributive({ ...sequence, polite: false }, options.conditionalEllipsisMoodAfterCarrier, requiresFuture);
201
- }
202
- if (options.directMannerAfterCarrier === true) {
203
- return {
204
- ...sequence,
205
- text: `${sequence.text}${requiresFuture
206
- ? `${selectParticle(sequence.text, "이라고/라고")} ${conjugate("하다", "여", "ㄹ/을")}`
207
- : selectParticle(sequence.text, "이라는/라는")}`,
208
- polite: false
209
- };
210
- }
211
- const carrierHostAttr = `${sequence.text} ${conjugate("하다", "여", "ㄴ/는")}`;
212
- const carrierLikeness = options.likenessAfterCarrier === undefined
213
- ? undefined
214
- : likenessAttributiveLexicalizationBase(options.likenessAfterCarrier, carrierHostAttr);
215
- if (carrierLikeness !== undefined) {
216
- const lexicalized = projectBaseAttributive(carrierLikeness, false, formal, "lexical", "default", likenessAttributiveLexicalizedPolicy(options.attrPolicy ?? "present"));
217
- if (lexicalized === null) {
218
- return { ok: false, reason: "carrier likeness attributive lexicalization projection failed" };
219
- }
220
- return { ...sequence, text: lexicalized, polite: false };
221
- }
222
- return {
223
- ...sequence,
224
- text: `${carrierHostAttr} 것 ${conjugate("같다", null, requiresFuture ? "ㄹ/을" : "ㄴ/은")}`,
225
- polite: false
226
- };
227
- }
228
- return connective.connective === "exemplification"
229
- ? { ...sequence, text: `${sequence.text} ${requiresFuture ? "할" : "하는"}`, polite: false }
230
- : {
231
- ...sequence,
232
- text: `${sequence.text}${requiresFuture
233
- ? `${selectParticle(sequence.text, "이라고/라고")} 할`
234
- : selectParticle(sequence.text, "이라는/라는")}`,
235
- polite: false
236
- };
237
- }
238
- function composeNegativeNounCopulaTerminal(prefix, final, past, formal, polite, lookups) {
239
- const base = negativeNounCopulaChainBase(final, formal);
240
- return composeBaseWithTerminal({ prefix: `${prefix}${base.prefix}`, final: base.final }, past, formal, polite, lookups);
241
- }
242
63
  function composeNegativeNounCopulaConnective(prefix, final, connective, past, formal, polite, lookups) {
243
64
  if (connective.surface === "と" && final.chainDepth === 0 && !past) {
244
65
  return composeNounCopulaNegativeToObligation(final.nounSurface, formal, polite, lookups, final.allomorphHost);
@@ -246,26 +67,6 @@ function composeNegativeNounCopulaConnective(prefix, final, connective, past, fo
246
67
  const base = negativeNounCopulaChainBase(final, formal);
247
68
  return composeCommittedTailConnective({ ok: true, base: { prefix: `${prefix}${base.prefix}`, final: base.final }, chainOnFinalSupported: true }, connective, past, polite, null, formal, lookups);
248
69
  }
249
- function composeLemmaBaseWithNegationTerminal(base, chainDepth, past, formal, polite, lookups, options = {}) {
250
- const lowered = applyExternalNegationDepthToPredicateBase(base, chainDepth, formal, options);
251
- if (lowered === null) {
252
- return { ok: false, reason: "chain on non-lemma base + terminal not supported" };
253
- }
254
- return composeBaseWithTerminal(lowered, past, formal, polite, lookups);
255
- }
256
- function composeBaseWithTerminalChainDepth(base, chainDepth, past, formal, polite, lookups, options = {}) {
257
- if (chainDepth < 0) {
258
- return { ok: false, reason: "negative terminal chain depth invariant violation" };
259
- }
260
- if (chainDepth === 0) {
261
- return composeBaseWithTerminal(base, past, formal, polite, lookups);
262
- }
263
- return composeLemmaBaseWithNegationTerminal(base, chainDepth, past, formal, polite, lookups, options);
264
- }
265
- export function composeBaseWithTerminalChain(base, finalNeg, past, formal, polite, lookups, options = {}) {
266
- const effectivePast = past || (finalNeg?.chainPast ?? false);
267
- return composeBaseWithTerminalChainDepth(base, finalNeg?.chainDepth ?? 0, effectivePast, formal, polite, lookups, negationLoweringOptionsWithOpFocus(finalNeg, options));
268
- }
269
70
  function composeBaseWithQuestionContentAlternative(base, connective, past, isPolite, preNeg, formal, lookups, options) {
270
71
  const effectivePast = past || (preNeg?.chainPast ?? false);
271
72
  if (preNeg === null &&
@@ -299,28 +100,6 @@ function composeBaseWithQuestionContentAlternative(base, connective, past, isPol
299
100
  }
300
101
  return { ok: true, text: `${question.text} 아닌지`, polite: question.polite };
301
102
  }
302
- export function attachCommittedChainTrace(result, baseResult) {
303
- if (!result.ok || !baseResult.ok) {
304
- return result;
305
- }
306
- const chainTrace = baseResult.chainSourceTrace;
307
- if (chainTrace === undefined) {
308
- return result;
309
- }
310
- if (result.traced !== undefined) {
311
- const rebound = rebindChainFinalPlaceholders(result.traced, chainTrace);
312
- if (rebound !== null) {
313
- return { ...result, traced: rebound };
314
- }
315
- const { traced: _dropped, ...rest } = result;
316
- return rest;
317
- }
318
- const traced = closeChainTraceAgainstText(chainTrace, result.text);
319
- if (traced === null) {
320
- return result;
321
- }
322
- return { ...result, traced };
323
- }
324
103
  function attachCommittedChainTraceFromPieces(result, baseResult) {
325
104
  if (!result.ok || !baseResult.ok || result.traced === undefined) {
326
105
  return result;
@@ -337,55 +116,6 @@ function attachCommittedChainTraceFromPieces(result, baseResult) {
337
116
  const { traced: _dropped, ...rest } = result;
338
117
  return rest;
339
118
  }
340
- export function composeCommittedTailTerminal(baseResult, finalNeg, past, formal, polite, lookups) {
341
- return composeCommittedTailTerminalDepth(baseResultWithNegationFocus(baseResult, finalNeg), finalNeg?.chainDepth ?? 0, past || (finalNeg?.chainPast ?? false), formal, polite, lookups);
342
- }
343
- export function composeCommittedTailTerminalDepth(baseResult, chainDepth, past, formal, polite, lookups) {
344
- if (!baseResult.ok) {
345
- return { ok: false, reason: baseResult.reason };
346
- }
347
- if (baseResult.terminalRealization?.kind === "exclamative" && chainDepth === 0) {
348
- const { terminalRealization: _exclamative, ...plainBaseResult } = baseResult;
349
- return attachCommittedChainTrace(composeCommittedTailDiscursiveSfp(plainBaseResult, null, past, formal, polite, "ne", lookups), baseResult);
350
- }
351
- if (baseResult.terminalRealization?.kind === "reported_request" &&
352
- chainDepth === 0 &&
353
- !past &&
354
- !polite &&
355
- !formal) {
356
- const requestBase = baseResult.terminalRealization.requestBase;
357
- if (requestBase.final.kind !== "lemma") {
358
- return { ok: false, reason: "reported request terminal requires a lemma request base" };
359
- }
360
- const requestHead = conjugate(requestBase.final.lemma, requestBase.final.irregular, "아/어");
361
- const terminal = normalizeGiveRequest(requestHead, requestBase.final.lemma, "달래");
362
- return attachCommittedChainTrace({
363
- ok: true,
364
- text: concatPredicatePrefix(requestBase.prefix, terminal),
365
- polite: false
366
- }, baseResult);
367
- }
368
- if (baseResult.terminalRealization?.kind === "elided_carrier" &&
369
- chainDepth === 0 &&
370
- !past) {
371
- return attachCommittedChainTrace({
372
- ok: true,
373
- text: baseResult.base.prefix.trimEnd(),
374
- polite: false
375
- }, baseResult);
376
- }
377
- if (chainDepth > 0 && baseResult.chainOnFinalSupported === false) {
378
- const lowered = lowerFinalNegationDepthForCommittedBase(baseResult, chainDepth, formal, lookups);
379
- if (lowered === null) {
380
- return { ok: false, reason: "chain on committed terminal final 영역 외 (자연도 / idiom 변환 영역)" };
381
- }
382
- const loweredForcesPast = finalNegationLoweringForcesPast(baseResult, chainDepth);
383
- const terminalBase = applyTerminalPrefixContraction(lowered, baseResult.terminalPrefixContraction, formal);
384
- return attachCommittedChainTrace(composeBaseWithTerminalChain(terminalBase, null, past || loweredForcesPast, formal, polite, lookups), baseResult);
385
- }
386
- const terminalBase = applyTerminalPrefixContraction(baseResult.base, baseResult.terminalPrefixContraction, formal);
387
- return attachCommittedChainTrace(composeBaseWithTerminalChainDepth(terminalBase, chainDepth, past, formal, polite, lookups, baseResult.finalNegationOptions), baseResult);
388
- }
389
119
  export function composeCommittedTailConnective(inputBaseResult, connective, past, isPolite, finalNeg, formal, lookups) {
390
120
  const baseResult = baseResultWithNegationFocus(inputBaseResult, finalNeg);
391
121
  if (!baseResult.ok) {
@@ -468,125 +198,6 @@ export function composeCommittedTailConnectiveWithNativeTrace(baseResult, connec
468
198
  }
469
199
  return rendered;
470
200
  }
471
- export function composeCommittedVolitionalRetrospectiveQuotative(baseResult, connective, past, isPolite, finalNeg, _formal, _lookups) {
472
- if (!baseResult.ok) {
473
- return { ok: false, reason: baseResult.reason };
474
- }
475
- if (connective.connective !== "retrospective_quotative") {
476
- return { ok: false, reason: "volitional retrospective lowering requires retrospective quotative" };
477
- }
478
- if (connective.retrospectiveQuotativeFlavor !== "direct_thought") {
479
- return { ok: false, reason: "volitional retrospective lowering requires direct-thought flavor" };
480
- }
481
- if (past || isPolite || finalNeg !== null) {
482
- return { ok: false, reason: "volitional retrospective lowering requires an unwrapped stem" };
483
- }
484
- const purpose = renderPredicateBaseVolitionalPurposeConnective(baseResult.base);
485
- return purpose.ok
486
- ? { ...purpose, text: `${purpose.text} 생각했더니` }
487
- : purpose;
488
- }
489
- export function composeCommittedVolitionalDeliberativeRetrospectiveQuotative(baseResult, connective, past, isPolite, finalNeg, _formal, _lookups) {
490
- if (!baseResult.ok) {
491
- return { ok: false, reason: baseResult.reason };
492
- }
493
- if (connective.connective !== "retrospective_quotative") {
494
- return { ok: false, reason: "volitional deliberative lowering requires retrospective quotative" };
495
- }
496
- if (connective.retrospectiveQuotativeFlavor !== "volitional_deliberative") {
497
- return { ok: false, reason: "volitional deliberative lowering requires deliberative flavor" };
498
- }
499
- if (past || isPolite || finalNeg !== null) {
500
- return { ok: false, reason: "volitional deliberative lowering requires an unwrapped stem" };
501
- }
502
- return renderPredicateBaseVolitionalDeliberativeRetrospective(baseResult.base);
503
- }
504
- export function composeCommittedVolitionalWishComplement(baseResult, connective, past, isPolite, finalNeg, _formal, _lookups) {
505
- if (!baseResult.ok) {
506
- return { ok: false, reason: baseResult.reason };
507
- }
508
- if (connective.connective !== "wish_complement") {
509
- return { ok: false, reason: "volitional wish lowering requires wish complement" };
510
- }
511
- if (past || isPolite || finalNeg !== null) {
512
- return { ok: false, reason: "volitional wish lowering requires an unwrapped stem" };
513
- }
514
- return renderPredicateBaseVolitionalPurposeConnective(baseResult.base);
515
- }
516
- export function composeCommittedVolitionalIntentQuoteAttributive(baseResult, connective, past, isPolite, finalNeg, _formal, _lookups) {
517
- if (!baseResult.ok) {
518
- return { ok: false, reason: baseResult.reason };
519
- }
520
- if (connective.connective !== "predicate_projection_quote_attributive") {
521
- return { ok: false, reason: "volitional quote-attributive lowering requires quote-attributive projection" };
522
- }
523
- if (connective.quoteAttributiveFlavor !== "intentional_modifier") {
524
- return { ok: false, reason: "volitional intent lowering requires intentional quote-attributive flavor" };
525
- }
526
- if (past || isPolite || finalNeg !== null) {
527
- return { ok: false, reason: "volitional quote-attributive lowering requires an unwrapped stem" };
528
- }
529
- return renderPredicateBaseVolitionalIntentAttributive(baseResult.base);
530
- }
531
- export function composeCommittedVolitionalCohortativeQuoteAttributive(baseResult, connective, past, isPolite, finalNeg, _formal, _lookups) {
532
- if (!baseResult.ok) {
533
- return { ok: false, reason: baseResult.reason };
534
- }
535
- if (connective.connective !== "predicate_projection_quote_attributive") {
536
- return { ok: false, reason: "volitional cohortative lowering requires quote-attributive projection" };
537
- }
538
- if (connective.quoteAttributiveFlavor !== "cohortative_quote") {
539
- return { ok: false, reason: "volitional cohortative lowering requires cohortative quote-attributive flavor" };
540
- }
541
- if (past || isPolite || finalNeg !== null) {
542
- return { ok: false, reason: "volitional cohortative lowering requires an unwrapped stem" };
543
- }
544
- return renderPredicateBaseVolitionalCohortativeAttributive(baseResult.base);
545
- }
546
- export function composeCommittedVolitionalRequestComplement(baseResult, connective, past, isPolite, finalNeg, _formal, _lookups) {
547
- if (!baseResult.ok) {
548
- return { ok: false, reason: baseResult.reason };
549
- }
550
- if (connective.connective !== "request_complement") {
551
- return { ok: false, reason: "volitional request lowering requires request complement" };
552
- }
553
- if (past || isPolite || finalNeg !== null) {
554
- return { ok: false, reason: "volitional request lowering requires an unwrapped stem" };
555
- }
556
- return renderPredicateBaseVolitionalQuotative(baseResult.base);
557
- }
558
- export function composeCommittedVolitionalReformulationQuestion(baseResult, connective, past, isPolite, finalNeg, _formal, _lookups) {
559
- if (!baseResult.ok) {
560
- return { ok: false, reason: baseResult.reason };
561
- }
562
- if (connective.connective !== "reformulation" ||
563
- connective.allomorph !== "reformulation_ka") {
564
- return {
565
- ok: false,
566
- reason: "volitional reformulation question requires reformulation-ka"
567
- };
568
- }
569
- if (past || isPolite || finalNeg !== null) {
570
- return {
571
- ok: false,
572
- reason: "volitional reformulation question requires an unwrapped stem"
573
- };
574
- }
575
- const quoted = renderPredicateBaseVolitionalQuotative(baseResult.base);
576
- return quoted.ok
577
- ? { ...quoted, text: `${quoted.text} 할까` }
578
- : quoted;
579
- }
580
- export function isConjectureQuestionContinuationConnective(connective) {
581
- return isQuestionContentConnective(connective) || connective.connective === "alternative";
582
- }
583
- export function composeCommittedBaseWithConjectureQuestionConnective(baseResult, connective, past, formal, isPolite) {
584
- if (!baseResult.ok) {
585
- return { ok: false, reason: baseResult.reason };
586
- }
587
- const connectiveBase = applyConnectivePrefixContraction(baseResult.base, baseResult.connectivePrefixContraction, formal);
588
- return composeBaseWithConjectureQuestionConnective(connectiveBase, connective, past, formal, isPolite);
589
- }
590
201
  export function composeCommittedTailTerminalTeForm(baseResult, connective, past, finalNeg, formal, lookups, utteranceClosing = false, iisashiClosing = false) {
591
202
  if (!baseResult.ok) {
592
203
  return { ok: false, reason: baseResult.reason };
@@ -668,553 +279,6 @@ function composeBaseWithTerminalTeForm(base, connective, past, finalNeg, formal,
668
279
  const request = conjugate(base.final.lemma, base.final.irregular, "아/어");
669
280
  return { ok: true, text: concatPredicatePrefix(base.prefix, request), polite: false };
670
281
  }
671
- export function conjectureBase(opts) {
672
- const { conjecture, stemLemma, stemIrregular, isVerb, preModalNeg, past, shortNegationPolicy, pastProjection } = opts;
673
- const conjecturePolite = conjecture.polite;
674
- const ok = (base) => ({
675
- ok: true,
676
- base,
677
- ...(() => {
678
- const sourceTrace = conjectureBaseSourceTrace(base, conjecture);
679
- return sourceTrace === undefined ? {} : { sourceTrace };
680
- })()
681
- });
682
- if (preModalNeg !== null) {
683
- if (preModalNeg.chainDepth >= 2) {
684
- return { ok: false, reason: "chain depth ≥ 2 + conjecture 영역 외" };
685
- }
686
- const negationFocus = preModalNeg.focusParticle ?? "";
687
- const negationAux = preModalNeg.inability === true ? "못하" : "않";
688
- if (past || preModalNeg.chainPast) {
689
- if (isVerb && preModalNeg.preferShortNegation) {
690
- if (stemLemma.endsWith("하다") && stemLemma.length > 2 && shortNegationPolicy !== "lexical_prefix") {
691
- const sahenPrefix = stemLemma.slice(0, -2);
692
- return ok({
693
- prefix: `${sahenPrefix} 안 했을 `,
694
- final: { kind: "boundNounCopula", nounSurface: "거" }
695
- });
696
- }
697
- return ok({
698
- prefix: `안 ${conjugate(stemLemma, stemIrregular, "았/었")}을 `,
699
- final: { kind: "boundNounCopula", nounSurface: "거" }
700
- });
701
- }
702
- return ok({
703
- prefix: `${conjugate(stemLemma, stemIrregular, "지")}${negationFocus} ${negationAux === "않" ? "않았을" : "못했을"} `,
704
- final: { kind: "boundNounCopula", nounSurface: "거" }
705
- });
706
- }
707
- const lexicalPotential = lexicalPotentialStemBase(stemLemma, stemIrregular, isVerb);
708
- if (lexicalPotential !== null) {
709
- const lowered = lowerPotentialFinalNegationBase(lexicalPotential, preModalNeg.chainDepth);
710
- if (lowered === null) {
711
- return { ok: false, reason: "lexical potential neg + conjecture invariant violation" };
712
- }
713
- const stemGet = conjugate(lowered.final.lemma, lowered.final.irregular, "겠");
714
- return ok({
715
- prefix: lowered.prefix,
716
- final: {
717
- kind: "lemma", lemma: `${stemGet}다`, irregular: null, isVerb: lowered.final.isVerb,
718
- idiom: {
719
- kind: "conjecture",
720
- conjecturePolite,
721
- sourceLemma: lowered.final.lemma,
722
- sourceIrregular: lowered.final.irregular
723
- }
724
- }
725
- });
726
- }
727
- if (isVerb && preModalNeg.preferShortNegation) {
728
- const stemGet = conjugate(stemLemma, stemIrregular, "겠");
729
- if (stemLemma.endsWith("하다") && stemLemma.length > 2 && shortNegationPolicy !== "lexical_prefix") {
730
- const sahenPrefix = stemLemma.slice(0, -2);
731
- return ok({
732
- prefix: `${sahenPrefix} 안 `,
733
- final: {
734
- kind: "lemma", lemma: "하겠다", irregular: null, isVerb: true,
735
- idiom: {
736
- kind: "conjecture",
737
- conjecturePolite,
738
- sourceLemma: "하다",
739
- sourceIrregular: "여",
740
- sourceNegation: "short"
741
- }
742
- }
743
- });
744
- }
745
- return ok({
746
- prefix: "안 ",
747
- final: {
748
- kind: "lemma", lemma: `${stemGet}다`, irregular: null, isVerb: true,
749
- idiom: {
750
- kind: "conjecture",
751
- conjecturePolite,
752
- sourceLemma: stemLemma,
753
- sourceIrregular: stemIrregular,
754
- sourceNegation: "short"
755
- }
756
- }
757
- });
758
- }
759
- const stemJi = conjugate(stemLemma, stemIrregular, "지");
760
- return ok({
761
- prefix: `${stemJi}${negationFocus} `,
762
- final: {
763
- kind: "lemma", lemma: `${negationAux}겠다`, irregular: null, isVerb: true,
764
- idiom: {
765
- kind: "conjecture",
766
- conjecturePolite,
767
- sourceLemma: stemLemma,
768
- sourceIrregular: stemIrregular,
769
- sourceNegation: "long",
770
- ...(preModalNeg.inability === true ? { sourceNegationInability: true } : {})
771
- }
772
- }
773
- });
774
- }
775
- if (past) {
776
- if (pastProjection === "committed") {
777
- const committedPast = stemLemma === "아니다"
778
- ? "아니었"
779
- : conjugate(stemLemma, stemIrregular, "았/었");
780
- return ok({
781
- prefix: "",
782
- final: {
783
- kind: "lemma", lemma: `${committedPast}겠다`, irregular: null, isVerb,
784
- idiom: { kind: "conjecture", conjecturePolite }
785
- }
786
- });
787
- }
788
- if (!isVerb) {
789
- const committedPast = conjugate(stemLemma, stemIrregular, "았/었");
790
- return ok({
791
- prefix: "",
792
- final: {
793
- kind: "lemma", lemma: `${committedPast}겠다`, irregular: null, isVerb: false,
794
- idiom: { kind: "conjecture", conjecturePolite }
795
- }
796
- });
797
- }
798
- const stemAttr = `${conjugate(stemLemma, stemIrregular, "았/었")}을`;
799
- return ok({
800
- prefix: `${stemAttr} `,
801
- final: { kind: "boundNounCopula", nounSurface: "거" }
802
- });
803
- }
804
- return ok(plainConjectureBase({ stemLemma, stemIrregular, isVerb, conjecturePolite }));
805
- }
806
- export function plainConjectureBase(opts) {
807
- const stemGet = conjugate(opts.stemLemma, opts.stemIrregular, "겠");
808
- return {
809
- prefix: "",
810
- final: {
811
- kind: "lemma", lemma: `${stemGet}다`, irregular: null, isVerb: opts.isVerb,
812
- idiom: {
813
- kind: "conjecture",
814
- conjecturePolite: opts.conjecturePolite,
815
- sourceLemma: opts.stemLemma,
816
- sourceIrregular: opts.stemIrregular
817
- }
818
- }
819
- };
820
- }
821
- export function projectBaseFutureAttributive(base, past, formal, pastProjection = "lexical") {
822
- if (base.final.kind === "negativeNounCopula") {
823
- const lowered = negativeNounCopulaChainBase(base.final, formal);
824
- return projectBaseFutureAttributive({ prefix: `${base.prefix}${lowered.prefix}`, final: lowered.final }, past, formal, pastProjection);
825
- }
826
- if (base.final.kind === "nounCopula" || base.final.kind === "boundNounCopula") {
827
- const noun = `${base.prefix}${base.final.nounSurface}`;
828
- if (past) {
829
- return `${noun}${hasBatchim(`${base.prefix}${nounCopulaFinalAllomorphHost(base.final)}`) ? "이었을" : "였을"}`;
830
- }
831
- return `${noun}일`;
832
- }
833
- const final = base.final;
834
- if (past) {
835
- if (base.policy?.kind === "noun_copula_interop" &&
836
- final.lemma === "이다" &&
837
- final.irregular === null) {
838
- return `${base.prefix}${selectParticle(predicateBasePolicyAllomorphHost(base), "이었/였")}을`;
839
- }
840
- if (pastProjection === "committed") {
841
- const pastStem = final.lemma === "아니다"
842
- ? "아니었"
843
- : conjugate(final.lemma, final.irregular, "았/었");
844
- return `${base.prefix}${pastStem}을`;
845
- }
846
- const pastStem = final.lemma === "아니다"
847
- ? "아니었"
848
- : conjugate(final.lemma, final.irregular, "았/었");
849
- return `${base.prefix}${pastStem}을`;
850
- }
851
- return `${base.prefix}${conjugate(final.lemma, final.irregular, "ㄹ/을")}`;
852
- }
853
- export function quotedPropositionAttributiveIsReused(base, past, policy) {
854
- const quoted = base.policy?.kind === "quoted_proposition" ? base.policy : null;
855
- if (past || quoted === null) {
856
- return false;
857
- }
858
- if (policy === "head_required_future" && quoted.attributiveQuote !== undefined && base.final.kind === "lemma") {
859
- return false;
860
- }
861
- return !isFutureAttributiveProjection(policy) ||
862
- quoted.attributiveQuote?.realizesInterrogativeMood === true;
863
- }
864
- export function likenessAttributiveLexicalizedPolicy(requestedPolicy) {
865
- return requestedPolicy === "future" ? "present" : requestedPolicy;
866
- }
867
- export function likenessAttributiveLexicalizationApplies(base, past) {
868
- return !past &&
869
- base.policy?.kind === "likeness" &&
870
- base.policy.attributiveLexicalization !== undefined;
871
- }
872
- export function projectBaseAttributive(base, past, formal, pastProjection = "lexical", negativeProjection = "default", requestedPolicy = "present") {
873
- const headRequiredFuture = requestedPolicy === "head_required_future";
874
- const attrPolicy = headRequiredFuture ? "future" : requestedPolicy;
875
- const likenessAttributive = base.policy?.kind === "likeness"
876
- ? base.policy.attributiveLexicalization
877
- : undefined;
878
- if (!past && likenessAttributive !== undefined) {
879
- return projectBaseAttributive(likenessAttributive, false, formal, pastProjection, negativeProjection, likenessAttributiveLexicalizedPolicy(requestedPolicy));
880
- }
881
- const quotedProposition = base.policy?.kind === "quoted_proposition" ? base.policy : null;
882
- if (!past && quotedProposition !== null) {
883
- if (quotedPropositionAttributiveIsReused(base, past, requestedPolicy)) {
884
- return quotedProposition.attributive;
885
- }
886
- if (headRequiredFuture && quotedProposition.attributiveQuote !== undefined && base.final.kind === "lemma") {
887
- return `${quotedProposition.attributiveQuote.prefix}${conjugate(base.final.lemma, base.final.irregular, "ㄹ/을")}`;
888
- }
889
- }
890
- if (base.final.kind === "negativeNounCopula") {
891
- const lowered = negativeNounCopulaChainBase(base.final, formal);
892
- return projectBaseAttributive({ prefix: `${base.prefix}${lowered.prefix}`, final: lowered.final }, past, formal, pastProjection, negativeProjection, requestedPolicy);
893
- }
894
- if (base.final.kind === "nounCopula" || base.final.kind === "boundNounCopula") {
895
- const noun = base.final.nounSurface;
896
- if (past) {
897
- const stem = nounPastCopulaStem(noun, nounCopulaFinalAllomorphHost(base.final));
898
- return `${base.prefix}${stem}${attrPolicy === "future" ? "을" : "던"}`;
899
- }
900
- if (attrPolicy === "future") {
901
- return `${base.prefix}${noun}${hasBatchim(noun) ? "일" : "일"}`;
902
- }
903
- return `${base.prefix}${noun}인`;
904
- }
905
- if (past && base.policy?.kind === "completion_potential") {
906
- return projectBaseAttributive(completionPotentialCompletedBase(base.policy), true, formal, pastProjection, negativeProjection, requestedPolicy);
907
- }
908
- if (past &&
909
- base.policy?.kind === "te_iru_negative" &&
910
- base.policy.mode === "completion" &&
911
- base.policy.completionAttributiveProjection === "long") {
912
- return `${base.policy.stemPrefix ?? ""}${conjugate(base.policy.stemLemma, base.policy.stemIrregular, "지")}${base.policy.negativeFocusParticle ?? ""} 않은`;
913
- }
914
- if (past && attrPolicy !== "future" && base.policy?.kind === "te_iru_attributive_contraction" &&
915
- base.final.kind === "lemma" && base.final.lemma === "있다" && !base.final.isVerb) {
916
- return conjugate(base.policy.stemLemma, base.policy.stemIrregular, "던");
917
- }
918
- if (past && attrPolicy !== "future" &&
919
- base.final.kind === "lemma" && base.final.lemma === "있다" && !base.final.isVerb &&
920
- base.policy?.kind === "voice" && base.policy.voice === "passive" &&
921
- base.prefix.endsWith("고 ")) {
922
- const passivePrefix = base.prefix.slice(0, -"고 ".length);
923
- if (passivePrefix.length > 0) {
924
- return `${passivePrefix}던`;
925
- }
926
- }
927
- const final = base.final;
928
- if (past) {
929
- if (base.policy?.kind === "noun_copula_interop" &&
930
- final.lemma === "이다" &&
931
- final.irregular === null) {
932
- const stem = selectParticle(predicateBasePolicyAllomorphHost(base), "이었/였");
933
- return `${base.prefix}${stem}${attrPolicy === "future" ? "을" : "던"}`;
934
- }
935
- if (attrPolicy === "future") {
936
- const pastStem = final.lemma === "아니다"
937
- ? "아니었"
938
- : conjugate(final.lemma, final.irregular, "았/었");
939
- return `${base.prefix}${pastStem}을`;
940
- }
941
- if (final.isVerb) {
942
- const pastAttributive = conjugate(final.lemma, final.irregular, "ㄴ/은");
943
- const pastNeutralized = pastAttributive === conjugate(final.lemma, final.irregular, "ㄴ/는");
944
- if (pastProjection === "committed" || pastNeutralized) {
945
- const pastStem = conjugate(final.lemma, final.irregular, "았/었");
946
- return `${base.prefix}${pastStem}던`;
947
- }
948
- return `${base.prefix}${pastAttributive}`;
949
- }
950
- const pastStem = final.lemma === "아니다"
951
- ? "아니었"
952
- : conjugate(final.lemma, final.irregular, "았/었");
953
- return `${base.prefix}${pastStem}던`;
954
- }
955
- const forceCompletedNegative = (negativeProjection === "scope_bridge" &&
956
- isBenefactiveNegativeCarrierPolicy(base.policy, final.lemma)) ||
957
- (negativeProjection === "completed_negative" && final.lemma === "않다");
958
- if (attrPolicy === "future") {
959
- return `${base.prefix}${conjugate(final.lemma, final.irregular, "ㄹ/을")}`;
960
- }
961
- const ending = final.isVerb && !forceCompletedNegative && attrPolicy !== "result_state" ? "ㄴ/는" : "ㄴ/은";
962
- return `${base.prefix}${conjugate(final.lemma, final.irregular, ending)}`;
963
- }
964
- export function composeCommittedBaseAttributive(baseResult, past, formal, pastProjection = "lexical", negativeProjection = "default", attrPolicy = "present") {
965
- if (!baseResult.ok) {
966
- return baseResult;
967
- }
968
- const text = projectBaseAttributive(baseResult.base, past, formal, pastProjection, negativeProjection, attrPolicy);
969
- if (text === null) {
970
- return { ok: false, reason: "committed base attributive projection failed" };
971
- }
972
- const trace = baseResult.chainSourceTrace;
973
- if (trace === undefined) {
974
- return { ok: true, text, polite: false };
975
- }
976
- const traced = quotedPropositionAttributiveIsReused(baseResult.base, past, attrPolicy) ||
977
- likenessAttributiveLexicalizationApplies(baseResult.base, past)
978
- ? rebindChainTraceForProjection(trace, text)
979
- : closeChainTraceAgainstText(trace, text);
980
- return {
981
- ok: true,
982
- text,
983
- polite: false,
984
- ...(traced === null ? {} : { traced })
985
- };
986
- }
987
- export function composeBaseWithTerminal(base, past, formal, isPolite, lookups) {
988
- if (past && base.policy?.kind === "completion_potential") {
989
- return composeBaseWithTerminal(completionPotentialCompletedBase(base.policy), true, formal, isPolite, lookups);
990
- }
991
- const prefix = base.prefix;
992
- if (base.final.kind === "negativeNounCopula") {
993
- return composeNegativeNounCopulaTerminal(prefix, base.final, past, formal, isPolite, lookups);
994
- }
995
- if (base.final.kind === "nounCopula") {
996
- const text = nounToCopulaForm(base.final.nounSurface, formal, isPolite, past, base.final.isBoundNoun, base.final.allomorphHost);
997
- return { ok: true, text: `${prefix}${text}`, polite: isPolite };
998
- }
999
- if (base.final.kind === "boundNounCopula") {
1000
- if (base.policy?.kind === "scope_carrier" &&
1001
- base.policy.carrier === "noda" &&
1002
- base.policy.style === "assertive_jya" &&
1003
- !past) {
1004
- const text = nounCopulaConnective(base.final.nounSurface, "지");
1005
- return { ok: true, text: `${prefix}${text}${isPolite ? "요" : ""}`, polite: isPolite };
1006
- }
1007
- const text = nounToCopulaForm(base.final.nounSurface, formal, isPolite, past, true);
1008
- return { ok: true, text: `${prefix}${text}`, polite: isPolite };
1009
- }
1010
- if (base.final.lemma === "아니다") {
1011
- const text = composeAniForm(formal, isPolite, past);
1012
- return { ok: true, text: `${prefix}${text}`, polite: isPolite };
1013
- }
1014
- if (base.final.idiom?.kind === "conjecture" && !past) {
1015
- if (base.final.kind === "lemma" && base.final.idiom.projection === "nominalized") {
1016
- return composeNominalizedConjectureTerminal(base, formal, isPolite);
1017
- }
1018
- const stem = base.final.lemma.replace(/다$/, "");
1019
- const polite = isPolite || base.final.idiom.conjecturePolite;
1020
- const ending = conjectureFinalForm(formal, polite);
1021
- return { ok: true, text: `${prefix}${stem}${ending}`, polite };
1022
- }
1023
- const text = composeFinalForm(base.final.lemma, base.final.irregular, base.final.isVerb, past, formal, isPolite, lookups);
1024
- return { ok: true, text: `${prefix}${text}`, polite: isPolite };
1025
- }
1026
- export function composeBaseWithPlainImperative(base, formal = false) {
1027
- if (base.final.kind !== "lemma") {
1028
- return { ok: false, reason: "imperative terminal on non-lemma base not supported" };
1029
- }
1030
- const body = conjugate(base.final.lemma, base.final.irregular, formal ? "아/어라" : "아/어");
1031
- return {
1032
- ok: true,
1033
- text: concatPredicatePrefix(base.prefix, body),
1034
- polite: false
1035
- };
1036
- }
1037
- export function composeBaseWithImperativeQuotative(base, complementizer = "고") {
1038
- if (base.final.kind !== "lemma") {
1039
- return { ok: false, reason: "imperative quotative requires lemma final" };
1040
- }
1041
- return {
1042
- ok: true,
1043
- text: concatPredicatePrefix(base.prefix, conjugate(base.final.lemma, base.final.irregular, `(으)라${complementizer}`)),
1044
- polite: false
1045
- };
1046
- }
1047
- export function composeContractedPastAspectTerminal(baseResult, explicitPast, formal, polite, lookups) {
1048
- if (!baseResult.ok) {
1049
- return { ok: false, reason: baseResult.reason };
1050
- }
1051
- const terminalBase = applyTerminalPrefixContraction(baseResult.base, baseResult.terminalPrefixContraction, formal);
1052
- if (terminalBase.final.kind !== "lemma") {
1053
- return { ok: false, reason: "te_iru contracted-past terminal on non-lemma base not supported" };
1054
- }
1055
- if (!explicitPast) {
1056
- return attachCommittedChainTrace(composeBaseWithTerminal(terminalBase, true, formal, polite, lookups), baseResult);
1057
- }
1058
- const text = composeDoublePastFinalForm(terminalBase.final.lemma, terminalBase.final.irregular, formal, polite);
1059
- return attachCommittedChainTrace({ ok: true, text: `${terminalBase.prefix}${text}`, polite }, baseResult);
1060
- }
1061
- function nominalizedConjectureStem(lemma) {
1062
- return lemma.endsWith("이겠다")
1063
- ? lemma.slice(0, -"이겠다".length)
1064
- : null;
1065
- }
1066
- function composeNominalizedConjectureTerminal(base, formal, isPolite) {
1067
- if (base.final.kind !== "lemma") {
1068
- return { ok: false, reason: "nominalized conjecture terminal invariant violation" };
1069
- }
1070
- const nominal = nominalizedConjectureStem(base.final.lemma);
1071
- if (nominal === null) {
1072
- return { ok: false, reason: "nominalized conjecture base invariant violation" };
1073
- }
1074
- const polite = isPolite || base.final.idiom?.conjecturePolite === true;
1075
- if (base.policy?.kind === "scope_carrier" &&
1076
- base.policy.carrier === "noda" &&
1077
- base.policy.style === "emphasis") {
1078
- return {
1079
- ok: true,
1080
- text: `${base.prefix}${nominal}이겠${polite ? "죠" : "지"}`,
1081
- polite
1082
- };
1083
- }
1084
- const casualNominal = !formal && nominal.endsWith("것")
1085
- ? `${nominal.slice(0, -"것".length)}거`
1086
- : nominal;
1087
- const stem = casualNominal.endsWith("거")
1088
- ? `${casualNominal}겠`
1089
- : `${casualNominal}이겠`;
1090
- return {
1091
- ok: true,
1092
- text: `${base.prefix}${stem}${polite ? "죠" : "지"}`,
1093
- polite
1094
- };
1095
- }
1096
- function lemmaCopulaConjectureBase(prefix, final, conjecturePolite) {
1097
- return {
1098
- ...plainConjectureBase({
1099
- stemLemma: final.lemma,
1100
- stemIrregular: final.irregular,
1101
- isVerb: final.isVerb,
1102
- conjecturePolite
1103
- }),
1104
- prefix
1105
- };
1106
- }
1107
- export function composeNounCopulaBaseWithConjecture(base, past, formal, isPolite, conjecturePolite, lookups) {
1108
- const polite = isPolite || conjecturePolite;
1109
- if (base.final.kind === "lemma") {
1110
- return composeBaseWithTerminal(lemmaCopulaConjectureBase(base.prefix, base.final, conjecturePolite), past, formal, polite, lookups);
1111
- }
1112
- if (base.final.kind === "nounCopula") {
1113
- return composeNounCopulaConjecture(base.prefix, base.final, past, formal, polite);
1114
- }
1115
- return composeNegativeNounCopulaConjecture(base.prefix, base.final, past, formal, polite);
1116
- }
1117
- export function composeNounCopulaConjectureQuestion(base, past, formal, polite) {
1118
- if (base.final.kind === "lemma") {
1119
- const lemmaQuestion = past
1120
- ? `${conjugate(base.final.lemma, base.final.irregular, "았/었")}을까`
1121
- : conjugate(base.final.lemma, base.final.irregular, "ㄹ/을까");
1122
- return `${base.prefix}${lemmaQuestion}${polite ? "요" : ""}`;
1123
- }
1124
- if (base.final.kind === "nounCopula") {
1125
- const noun = base.final.nounSurface;
1126
- const noBatchim = hasBatchim(nounCopulaFinalAllomorphHost(base.final)) === false;
1127
- const attr = past
1128
- ? `${noun}${noBatchim ? "였" : "이었"}을`
1129
- : `${noun}일`;
1130
- return `${base.prefix}${attr}까${polite ? "요" : ""}`;
1131
- }
1132
- const chainBase = negativeNounCopulaChainBase(base.final, formal);
1133
- const attr = chainBase.final.kind === "lemma" && chainBase.final.lemma === "않다"
1134
- ? (past ? "않았을" : "않을")
1135
- : (past ? "아니었을" : "아닐");
1136
- return `${base.prefix}${chainBase.prefix}${attr}까${polite ? "요" : ""}`;
1137
- }
1138
- export function composeNounCopulaBaseWithConjectureConnective(base, connective, past, formal, isPolite, lookups) {
1139
- if (isConjectureQuestionContinuationConnective(connective)) {
1140
- return composeBaseWithConjectureQuestionConnective(base, connective, past, formal, isPolite);
1141
- }
1142
- if (base.final.kind === "lemma") {
1143
- if (connective.connective === "quotative") {
1144
- const attributive = projectBaseFutureAttributive(base, past, formal);
1145
- if (attributive !== null) {
1146
- return { ok: true, text: `${attributive} 거라고`, polite: false };
1147
- }
1148
- }
1149
- return composeBaseWithConnective(lemmaCopulaConjectureBase(base.prefix, base.final, false), connective, past, isPolite, null, formal, lookups);
1150
- }
1151
- const nounCopulaBase = { ...base, final: base.final };
1152
- if (connective.connective === "quotative") {
1153
- return composeNounCopulaConjectureQuotative(nounCopulaBase, past, formal, isPolite);
1154
- }
1155
- const lowered = nounCopulaConjectureConnectiveBase(nounCopulaBase, past, formal);
1156
- return composeBaseWithConnective(lowered, connective, false, isPolite, null, formal, lookups);
1157
- }
1158
- function composeNounCopulaConjectureQuotative(base, past, formal, isPolite) {
1159
- void isPolite;
1160
- if (base.final.kind === "nounCopula") {
1161
- const noun = base.final.nounSurface;
1162
- const noBatchim = hasBatchim(nounCopulaFinalAllomorphHost(base.final)) === false;
1163
- const attr = past
1164
- ? (noBatchim ? `${noun}였을` : `${noun}이었을`)
1165
- : `${noun}일`;
1166
- return { ok: true, text: `${base.prefix}${attr} 거라고`, polite: false };
1167
- }
1168
- const chainBase = negativeNounCopulaChainBase(base.final, formal);
1169
- const chainFinalLemma = chainBase.final.kind === "lemma" ? chainBase.final.lemma : "아니다";
1170
- const attr = chainFinalLemma === "않다"
1171
- ? (past ? "않았을" : "않을")
1172
- : (past ? "아니었을" : "아닐");
1173
- return { ok: true, text: `${base.prefix}${chainBase.prefix}${attr} 거라고`, polite: false };
1174
- }
1175
- function nounCopulaConjectureConnectiveBase(base, past, formal) {
1176
- if (base.final.kind === "nounCopula") {
1177
- const noun = base.final.nounSurface;
1178
- const noBatchim = hasBatchim(nounCopulaFinalAllomorphHost(base.final)) === false;
1179
- const stem = past
1180
- ? (noBatchim ? `${noun}였겠` : `${noun}이었겠`)
1181
- : (noBatchim ? `${noun}겠` : `${noun}이겠`);
1182
- return {
1183
- prefix: base.prefix,
1184
- final: { kind: "lemma", lemma: `${stem}다`, irregular: null, isVerb: false }
1185
- };
1186
- }
1187
- const chainBase = negativeNounCopulaChainBase(base.final, formal);
1188
- const chainFinalLemma = chainBase.final.kind === "lemma" ? chainBase.final.lemma : "아니다";
1189
- const stem = chainFinalLemma === "않다"
1190
- ? (past ? "않았겠" : "않겠")
1191
- : (past ? "아니었겠" : "아니겠");
1192
- return {
1193
- prefix: `${base.prefix}${chainBase.prefix}`,
1194
- final: { kind: "lemma", lemma: `${stem}다`, irregular: null, isVerb: false }
1195
- };
1196
- }
1197
- function composeNounCopulaConjecture(prefix, final, past, formal, polite) {
1198
- const noun = final.nounSurface;
1199
- const noBatchim = hasBatchim(nounCopulaFinalAllomorphHost(final)) === false;
1200
- const stem = past
1201
- ? `${noun}${noBatchim ? "였겠" : "이었겠"}`
1202
- : `${noun}${noBatchim ? "겠" : "이겠"}`;
1203
- const ending = polite ? "죠" : "지";
1204
- return { ok: true, text: `${prefix}${stem}${ending}`, polite };
1205
- }
1206
- function composeNegativeNounCopulaConjecture(prefix, final, past, formal, polite) {
1207
- const base = negativeNounCopulaChainBase(final, formal);
1208
- if (base.final.kind === "lemma" && base.final.lemma === "아니다") {
1209
- const stem = past ? "아니었겠" : "아니겠";
1210
- return { ok: true, text: `${prefix}${base.prefix}${stem}${polite ? "죠" : "지"}`, polite };
1211
- }
1212
- if (base.final.kind === "lemma" && base.final.lemma === "않다") {
1213
- const stem = past ? "않았겠" : "않겠";
1214
- return { ok: true, text: `${prefix}${base.prefix}${stem}${polite ? "죠" : "지"}`, polite };
1215
- }
1216
- return { ok: false, reason: "negative noun copula conjecture base invariant violation" };
1217
- }
1218
282
  function composeBaseWithBoundNominalReason(base, connective, past, preNeg, formal, lookups, options) {
1219
283
  const loweredBase = lowerBaseKeepingFinal(base, preNeg, formal, options);
1220
284
  if (loweredBase === null) {
@@ -1266,100 +330,9 @@ export function isMonoBoundReasonConnective(connective) {
1266
330
  return connective.connective === "bound_nominal_reason" &&
1267
331
  connective.boundNominalReasonMonoNoun === true;
1268
332
  }
1269
- export function projectBaseMNominalized(base, past, formal) {
1270
- if (base.final.kind === "negativeNounCopula") {
1271
- const lowered = negativeNounCopulaChainBase(base.final, formal);
1272
- return projectBaseMNominalized({ prefix: `${base.prefix}${lowered.prefix}`, final: lowered.final }, past, formal);
1273
- }
1274
- if (base.final.kind === "nounCopula" || base.final.kind === "boundNounCopula") {
1275
- const noun = `${base.prefix}${base.final.nounSurface}`;
1276
- if (past) {
1277
- return `${noun}${hasBatchim(`${base.prefix}${nounCopulaFinalAllomorphHost(base.final)}`) ? "이었음" : "였음"}`;
1278
- }
1279
- return noun.endsWith("이") ? `${noun}기` : `${noun}임`;
1280
- }
1281
- const final = base.final;
1282
- if (past) {
1283
- const stem = final.lemma === "아니다"
1284
- ? "아니었"
1285
- : conjugate(final.lemma, final.irregular, "았/었");
1286
- return `${base.prefix}${stem}음`;
1287
- }
1288
- return `${base.prefix}${conjugate(final.lemma, final.irregular, "ㅁ/음")}`;
1289
- }
1290
- export function projectBaseReasonGerund(base, past, formal) {
1291
- if (base.final.kind === "negativeNounCopula") {
1292
- const lowered = negativeNounCopulaChainBase(base.final, formal);
1293
- return projectBaseReasonGerund({ prefix: `${base.prefix}${lowered.prefix}`, final: lowered.final }, past, formal);
1294
- }
1295
- if (base.final.kind === "nounCopula" || base.final.kind === "boundNounCopula") {
1296
- const realizedSurface = uncontractedBoundNounSurface(base.final);
1297
- const noun = `${base.prefix}${realizedSurface}`;
1298
- if (past) {
1299
- const host = `${base.prefix}${nounCopulaRealizedAllomorphHost(base.final, realizedSurface)}`;
1300
- return `${noun}${hasBatchim(host) ? "이었기" : "였기"}`;
1301
- }
1302
- return noun.endsWith("이") ? `${noun}기` : `${noun}이기`;
1303
- }
1304
- const final = base.final;
1305
- if (past) {
1306
- return `${base.prefix}${conjugate(final.lemma, final.irregular, "았/었")}기`;
1307
- }
1308
- const quotedProposition = base.policy?.kind === "quoted_proposition" ? base.policy : null;
1309
- if (quotedProposition?.attributiveQuote !== undefined) {
1310
- return `${quotedProposition.attributiveQuote.prefix}${conjugate(final.lemma, final.irregular, "기")}`;
1311
- }
1312
- return `${base.prefix}${conjugate(final.lemma, final.irregular, "기")}`;
1313
- }
1314
- function uncontractedBoundNounSurface(final) {
1315
- return final.kind === "boundNounCopula" && final.nounSurface === "거" ? "것" : final.nounSurface;
1316
- }
1317
333
  function copulaFusedHostSurface(nounSurface, lookups) {
1318
334
  return lookups.COPULA_FUSED_BOUND_NOUNS.get(nounSurface);
1319
335
  }
1320
- export function plainDeclarativeToPointAttributive(text, options = {}) {
1321
- if (options.copularLemma !== undefined && text.endsWith(options.copularLemma)) {
1322
- return `${text.slice(0, -"다".length)}라는`;
1323
- }
1324
- if (text.endsWith("아니다")) {
1325
- return `${text.slice(0, -"아니다".length)}아니라는`;
1326
- }
1327
- if (text.endsWith("이다")) {
1328
- const stem = text.slice(0, -"이다".length);
1329
- return `${stem}${hasBatchim(stem) ? "이라는" : "라는"}`;
1330
- }
1331
- if (text.endsWith("거다")) {
1332
- return `${text.slice(0, -"거다".length)}거라는`;
1333
- }
1334
- if (text.endsWith("다")) {
1335
- return `${text}는`;
1336
- }
1337
- return `${text}라는`;
1338
- }
1339
- export function plainDeclarativeToPointAttributiveNominal(text, noun, allomorphHost, options = {}) {
1340
- if (text === `${noun}다`) {
1341
- return `${noun}${hasBatchim(allomorphHost ?? noun) ? "이라는" : "라는"}`;
1342
- }
1343
- return plainDeclarativeToPointAttributive(text, options);
1344
- }
1345
- export function composeBaseWithPredicateProjectionQuoteAttributive(base, past, isPolite, preNeg, formal, lookups, options) {
1346
- const loweredBase = lowerBaseKeepingFinal(base, preNeg, formal, options);
1347
- if (loweredBase === null) {
1348
- return { ok: false, reason: "predicate quote attributive projection chain lowering not supported" };
1349
- }
1350
- const effectivePast = past || (preNeg?.chainPast ?? false);
1351
- if (!effectivePast &&
1352
- (loweredBase.final.kind === "nounCopula" || loweredBase.final.kind === "boundNounCopula")) {
1353
- const nounPhrase = `${loweredBase.prefix}${loweredBase.final.nounSurface}`;
1354
- const quoteAttr = hasBatchim(`${loweredBase.prefix}${nounCopulaFinalAllomorphHost(loweredBase.final)}`) ? "이라는" : "라는";
1355
- return { ok: true, text: `${nounPhrase}${quoteAttr}`, polite: isPolite };
1356
- }
1357
- const rendered = composeBaseWithTerminalChain(loweredBase, null, effectivePast, true, false, lookups, options);
1358
- if (!rendered.ok) {
1359
- return rendered;
1360
- }
1361
- return { ok: true, text: plainDeclarativeToPointAttributive(rendered.text), polite: isPolite };
1362
- }
1363
336
  function composeBaseWithQuotativeMannerSimile(base, past, preNeg, formal, lookups, options, suffix, connective) {
1364
337
  const mood = connective.quotativeMood ?? "declarative";
1365
338
  if (mood === "imperative") {
@@ -1499,13 +472,6 @@ const TARI_ENUMERATIVE_COMPOSE_RULE = {
1499
472
  failProjection: "たり enumerative nominalization not supported",
1500
473
  render: (proj, ctx) => `${proj}도${ctx.politeSuffix}`
1501
474
  };
1502
- function connectiveFocusParticleSuffix(surface, precedingKorean) {
1503
- if (surface.endsWith("は"))
1504
- return selectParticle(precedingKorean, "은/는");
1505
- if (surface.endsWith("も"))
1506
- return selectParticle(precedingKorean, "도");
1507
- return "";
1508
- }
1509
475
  const PROJECTION_COMPOSE_RULES = new Map([
1510
476
  ["additive_besides", {
1511
477
  projection: "attributive", politeFromCaller: true,
@@ -1812,6 +778,7 @@ export function exemplificationTakesClosedPropositionComplement(connective) {
1812
778
  CONNECTIVE_RENDER_MAP.get(connectiveRenderSurface(connective))?.suffixText !== undefined;
1813
779
  }
1814
780
  export function composeBaseWithConnective(base, connective, past, isPolite, preNeg, formal, lookups, options = {}) {
781
+ const args = { base, connective, past, isPolite, preNeg, formal, lookups, options };
1815
782
  if (connective.connective === "exemplification" && connective.closedSfp !== undefined) {
1816
783
  return composeBaseWithSfpClosedExemplification(base, connective, past, isPolite, preNeg, formal, lookups, options);
1817
784
  }
@@ -1822,18 +789,7 @@ export function composeBaseWithConnective(base, connective, past, isPolite, preN
1822
789
  return composeBaseWithKuseNiConnective(base, connective, past, isPolite, preNeg, formal, options);
1823
790
  }
1824
791
  if (connective.connective === "te_form") {
1825
- const role = connective.teFormRole ?? defaultTeFormRoleForBase(base, preNeg, connective);
1826
- if (role === "adverbial") {
1827
- return composeBaseWithAdverbialTeForm(base, past, preNeg, formal, lookups, options);
1828
- }
1829
- if (role === "manner") {
1830
- return { ok: false, reason: "te_form manner requires StructuralRelation simultaneous projection" };
1831
- }
1832
- if (role === "compound_serial") {
1833
- return composeBaseWithCompoundSerialTeForm(base, past, preNeg, formal, options);
1834
- }
1835
- const lowered = teFormRoleToConnective(connective, role);
1836
- return composeBaseWithConnective(base, lowered, role === "linkage" ? false : past, isPolite, preNeg, formal, lookups, options);
792
+ return composeTeFormConnective(args);
1837
793
  }
1838
794
  if (connective.connective === "alternative") {
1839
795
  return composeBaseWithConnective(base, { ...connective, connective: "listing", surface: "__alternative_ka" }, past, isPolite, preNeg, formal, lookups, options);
@@ -1856,6 +812,55 @@ export function composeBaseWithConnective(base, connective, past, isPolite, preN
1856
812
  const obligationCore = `${stemAe}야${obligationEmphasis(base.policy.variant)}`;
1857
813
  return { ok: true, text: `${obligationCore} 할지`, polite: false };
1858
814
  }
815
+ const shortNegationQuestion = composeShortNegationQuestionContent(args);
816
+ if (shortNegationQuestion !== NOT_COMPOSED) {
817
+ return shortNegationQuestion;
818
+ }
819
+ const ruleTableComposed = composeByConnectiveRuleTable(args);
820
+ if (ruleTableComposed !== NOT_COMPOSED) {
821
+ return ruleTableComposed;
822
+ }
823
+ const dedicatedKindComposed = composeByDedicatedConnectiveKind(args);
824
+ if (dedicatedKindComposed !== NOT_COMPOSED) {
825
+ return dedicatedKindComposed;
826
+ }
827
+ const chainDepth = preNeg?.chainDepth ?? 0;
828
+ const dedicatedProjectionComposed = composeByDedicatedProjectionConnectiveKind(args);
829
+ if (dedicatedProjectionComposed !== NOT_COMPOSED) {
830
+ return dedicatedProjectionComposed;
831
+ }
832
+ const negativeNounCopulaComposed = composeNegativeNounCopulaFinalConnective(args, chainDepth);
833
+ if (negativeNounCopulaComposed !== NOT_COMPOSED) {
834
+ return negativeNounCopulaComposed;
835
+ }
836
+ const nounCopulaComposed = composeNounCopulaFinalConnective(args, chainDepth);
837
+ if (nounCopulaComposed !== NOT_COMPOSED) {
838
+ return nounCopulaComposed;
839
+ }
840
+ const boundNounCopulaComposed = composeBoundNounCopulaFinalConnective(args, chainDepth);
841
+ if (boundNounCopulaComposed !== NOT_COMPOSED) {
842
+ return boundNounCopulaComposed;
843
+ }
844
+ return composeLemmaBaseConnective(args, chainDepth);
845
+ }
846
+ const NOT_COMPOSED = Symbol("connective compose: not applicable");
847
+ function composeTeFormConnective(args) {
848
+ const { base, connective, past, isPolite, preNeg, formal, lookups, options } = args;
849
+ const role = connective.teFormRole ?? defaultTeFormRoleForBase(base, preNeg, connective);
850
+ if (role === "adverbial") {
851
+ return composeBaseWithAdverbialTeForm(base, past, preNeg, formal, lookups, options);
852
+ }
853
+ if (role === "manner") {
854
+ return { ok: false, reason: "te_form manner requires StructuralRelation simultaneous projection" };
855
+ }
856
+ if (role === "compound_serial") {
857
+ return composeBaseWithCompoundSerialTeForm(base, past, preNeg, formal, options);
858
+ }
859
+ const lowered = teFormRoleToConnective(connective, role);
860
+ return composeBaseWithConnective(base, lowered, role === "linkage" ? false : past, isPolite, preNeg, formal, lookups, options);
861
+ }
862
+ function composeShortNegationQuestionContent(args) {
863
+ const { base, connective, past, isPolite, preNeg, lookups } = args;
1859
864
  if (preNeg?.chainDepth === 1 &&
1860
865
  preNeg.preferShortNegation &&
1861
866
  (connective.connective === "question_content" || connective.connective === "question_quotative") &&
@@ -1886,6 +891,10 @@ export function composeBaseWithConnective(base, connective, past, isPolite, preN
1886
891
  polite: isPolite
1887
892
  };
1888
893
  }
894
+ return NOT_COMPOSED;
895
+ }
896
+ function composeByConnectiveRuleTable(args) {
897
+ const { base, connective, past, isPolite, preNeg, formal, options } = args;
1889
898
  const projectionRule = PROJECTION_COMPOSE_RULES.get(connective.connective);
1890
899
  const hasSurfaceRenderRule = resolveConnectiveEnding(connectiveRenderSurface(connective), true, false)?.suffixText !== undefined;
1891
900
  if (projectionRule !== undefined && !(connective.connective === "exemplification" && hasSurfaceRenderRule)) {
@@ -1903,6 +912,10 @@ export function composeBaseWithConnective(base, connective, past, isPolite, preN
1903
912
  }, base, connective, past, isPolite, preNeg, formal, options);
1904
913
  }
1905
914
  }
915
+ return NOT_COMPOSED;
916
+ }
917
+ function composeByDedicatedConnectiveKind(args) {
918
+ const { base, connective, past, isPolite, preNeg, formal, lookups, options } = args;
1906
919
  if (connective.connective === "sequence_after") {
1907
920
  return composeBaseWithSequenceAfter(base, connective, past, isPolite, preNeg, formal, lookups, options);
1908
921
  }
@@ -1943,7 +956,10 @@ export function composeBaseWithConnective(base, connective, past, isPolite, preN
1943
956
  if (connective.connective === "request_complement") {
1944
957
  return composeBaseWithRequestComplement(base, past, preNeg, options, connective);
1945
958
  }
1946
- const chainDepth = preNeg?.chainDepth ?? 0;
959
+ return NOT_COMPOSED;
960
+ }
961
+ function composeByDedicatedProjectionConnectiveKind(args) {
962
+ const { base, connective, past, isPolite, preNeg, formal, lookups, options } = args;
1947
963
  if (connective.connective === "external_nominalizer_concessive") {
1948
964
  const adversative = composeBaseWithConnective(base, { ...connective, connective: "adversative", surface: "のに" }, past, false, preNeg, formal, lookups, options);
1949
965
  if (!adversative.ok) {
@@ -1987,6 +1003,10 @@ export function composeBaseWithConnective(base, connective, past, isPolite, preN
1987
1003
  if (connective.connective === "predicate_projection_quotative_manner_simile_attributive") {
1988
1004
  return composeBaseWithQuotativeMannerSimile(base, past, preNeg, formal, lookups, options, "듯한", connective);
1989
1005
  }
1006
+ return NOT_COMPOSED;
1007
+ }
1008
+ function composeNegativeNounCopulaFinalConnective(args, chainDepth) {
1009
+ const { base, connective, past, isPolite, preNeg, formal, lookups, options } = args;
1990
1010
  if (base.final.kind === "negativeNounCopula") {
1991
1011
  if (chainDepth >= 1) {
1992
1012
  const lowered = applyExternalNegationDepthToPredicateBase(base, chainDepth, formal, options);
@@ -1997,6 +1017,10 @@ export function composeBaseWithConnective(base, connective, past, isPolite, preN
1997
1017
  }
1998
1018
  return composeNegativeNounCopulaConnective(base.prefix, base.final, connective, past, formal, isPolite, lookups);
1999
1019
  }
1020
+ return NOT_COMPOSED;
1021
+ }
1022
+ function composeNounCopulaFinalConnective(args, chainDepth) {
1023
+ const { base, connective, past, isPolite, preNeg, formal, lookups, options } = args;
2000
1024
  if (base.final.kind === "nounCopula") {
2001
1025
  if (preNeg !== null && connective.surface === "と" && chainDepth === 1 && !past && !preNeg.chainPast) {
2002
1026
  return composeNounCopulaNegativeToObligation(base.final.nounSurface, formal, isPolite, lookups, nounCopulaFinalAllomorphHost(base.final));
@@ -2020,6 +1044,10 @@ export function composeBaseWithConnective(base, connective, past, isPolite, preN
2020
1044
  return composeNounCopulaConnective(base.prefix, copulaHostSurface, connective, past, isPolite, formal, base.policy?.kind === "scope_carrier" &&
2021
1045
  base.policy.connectiveSourcePoliteness === "preserve_when_supported", nounCopulaFinalAllomorphHost(base.final), copulaFusedHostSurface(copulaHostSurface, lookups));
2022
1046
  }
1047
+ return NOT_COMPOSED;
1048
+ }
1049
+ function composeBoundNounCopulaFinalConnective(args, chainDepth) {
1050
+ const { base, connective, past, isPolite, preNeg, formal, lookups, options } = args;
2023
1051
  if (base.final.kind === "boundNounCopula") {
2024
1052
  if (chainDepth >= 1) {
2025
1053
  const lowered = applyExternalNegationDepthToPredicateBase(base, chainDepth, formal, options);
@@ -2032,6 +1060,10 @@ export function composeBaseWithConnective(base, connective, past, isPolite, preN
2032
1060
  return composeNounCopulaConnective(base.prefix, boundNounSurface, connective, past, isPolite, formal, base.policy?.kind === "scope_carrier" &&
2033
1061
  base.policy.connectiveSourcePoliteness === "preserve_when_supported", undefined, copulaFusedHostSurface(boundNounSurface, lookups));
2034
1062
  }
1063
+ return NOT_COMPOSED;
1064
+ }
1065
+ function composeLemmaBaseConnective(args, chainDepth) {
1066
+ const { base, connective, past, isPolite, preNeg, formal, options } = args;
2035
1067
  const loweredBase = applyNegationChainToLemmaBase(base, preNeg, options);
2036
1068
  if (loweredBase === null) {
2037
1069
  return { ok: false, reason: "chain on non-lemma base + connective not supported" };
@@ -2157,95 +1189,6 @@ function splitConjugatedConnectiveEnding(finalText, endingTemplate) {
2157
1189
  }
2158
1190
  return null;
2159
1191
  }
2160
- function composeBaseWithYouNiPurpose(base, past, isPolite, preNeg, formal, options) {
2161
- if (base.final.kind === "nounCopula" && preNeg === null && !past) {
2162
- return {
2163
- ok: true,
2164
- text: `${base.prefix}${base.final.nounSurface}이도록`,
2165
- polite: false
2166
- };
2167
- }
2168
- const loweredBase = lowerBaseForPredicateProjection(base, preNeg, formal, options);
2169
- if (loweredBase === null) {
2170
- return { ok: false, reason: "ように purpose projection chain lowering not supported" };
2171
- }
2172
- const effectivePast = past || (preNeg?.chainPast ?? false);
2173
- if (effectivePast) {
2174
- return composeBaseWithYouNiMannerSimile(base, past, isPolite, preNeg, formal, options);
2175
- }
2176
- const finalText = conjugate(loweredBase.final.lemma, loweredBase.final.irregular, "도록");
2177
- return {
2178
- ok: true,
2179
- text: `${loweredBase.prefix}${finalText}${isPolite ? "요" : ""}`,
2180
- polite: isPolite
2181
- };
2182
- }
2183
- function composeBaseWithNiwaIntentionalPurpose(base, preNeg, formal, options) {
2184
- const loweredBase = lowerBaseForPredicateProjection(base, preNeg, formal, options);
2185
- if (loweredBase === null || loweredBase.final.kind !== "lemma") {
2186
- return { ok: false, reason: "には intentional-purpose projection lowering not supported" };
2187
- }
2188
- const finalText = conjugate(loweredBase.final.lemma, loweredBase.final.irregular, "(으)려면");
2189
- return {
2190
- ok: true,
2191
- text: `${loweredBase.prefix}${finalText}`,
2192
- polite: false
2193
- };
2194
- }
2195
- function composeBaseWithPurposeMotion(base, preNeg, formal, options) {
2196
- const loweredBase = lowerBaseForPredicateProjection(base, preNeg, formal, options);
2197
- if (loweredBase === null || loweredBase.final.kind !== "lemma") {
2198
- return { ok: false, reason: "purpose-motion connective lowering not supported" };
2199
- }
2200
- const finalText = conjugate(loweredBase.final.lemma, loweredBase.final.irregular, "(으)러");
2201
- return {
2202
- ok: true,
2203
- text: `${loweredBase.prefix}${finalText}`,
2204
- polite: false
2205
- };
2206
- }
2207
- function composeBaseWithYouNiAttributiveSuffix(base, past, isPolite, preNeg, formal, options, suffix, label) {
2208
- const loweredBase = lowerBaseForPredicateProjection(base, preNeg, formal, options);
2209
- if (loweredBase === null) {
2210
- return { ok: false, reason: `ように ${label} projection chain lowering not supported` };
2211
- }
2212
- const attr = projectBaseAttributive(loweredBase, past || (preNeg?.chainPast ?? false), formal);
2213
- if (attr === null) {
2214
- return { ok: false, reason: `ように ${label} attributive projection not supported` };
2215
- }
2216
- return {
2217
- ok: true,
2218
- text: `${attr} ${suffix}${isPolite ? "요" : ""}`,
2219
- polite: isPolite
2220
- };
2221
- }
2222
- function composeBaseWithYouNiMannerSimile(base, past, isPolite, preNeg, formal, options) {
2223
- return composeBaseWithYouNiAttributiveSuffix(base, past, isPolite, preNeg, formal, options, "것처럼", "manner/simile");
2224
- }
2225
- function composeBaseWithYouNiMannerVolitional(base, past, isPolite, preNeg, formal, options) {
2226
- return composeBaseWithYouNiAttributiveSuffix(base, past, isPolite, preNeg, formal, options, "대로", "volitional manner");
2227
- }
2228
- export function appearanceAdverbialLexicalizationApplies(base, past, preNeg) {
2229
- return !past &&
2230
- preNeg === null &&
2231
- base.policy?.kind === "likeness" &&
2232
- base.policy.adverbialLexicalization !== undefined;
2233
- }
2234
- function composeBaseWithYouNiMannerSimileAction(base, past, isPolite, preNeg, formal, options) {
2235
- if (appearanceAdverbialLexicalizationApplies(base, past, preNeg)) {
2236
- const lexicalization = base.policy?.kind === "likeness"
2237
- ? base.policy.adverbialLexicalization
2238
- : undefined;
2239
- if (lexicalization !== undefined) {
2240
- return {
2241
- ok: true,
2242
- text: `${lexicalization.prefix}듯이${isPolite ? "요" : ""}`,
2243
- polite: isPolite
2244
- };
2245
- }
2246
- }
2247
- return composeBaseWithYouNiAttributiveSuffix(base, past, isPolite, preNeg, formal, options, "듯이", "action simile");
2248
- }
2249
1192
  function composeBaseWithSequenceAfter(base, connective, past, isPolite, preNeg, formal, lookups, options) {
2250
1193
  const listing = composeBaseWithConnective(base, { ...connective, connective: "listing", surface: "し" }, past, false, preNeg, formal, lookups, options);
2251
1194
  if (!listing.ok) {
@@ -2426,391 +1369,6 @@ function nounSurfaceForConnective(base, connective, past) {
2426
1369
  }
2427
1370
  return "";
2428
1371
  }
2429
- function composeNominalizedConjectureConnective(base, connectiveSurface, isPolite, formal, connectiveType) {
2430
- if (base.final.kind !== "lemma") {
2431
- return { ok: false, reason: "nominalized conjecture connective invariant violation" };
2432
- }
2433
- const nominal = nominalizedConjectureStem(base.final.lemma);
2434
- if (nominal === null) {
2435
- return { ok: false, reason: "nominalized conjecture connective invariant violation" };
2436
- }
2437
- if (connectiveType === "question_content" ||
2438
- connectiveType === "question_quotative" ||
2439
- connectiveType === "alternative") {
2440
- return { ok: true, text: `${base.prefix}${nominal}일지`, polite: false };
2441
- }
2442
- const connectivePolite = isPolite || (!formal &&
2443
- base.policy?.kind === "scope_carrier" &&
2444
- base.policy.carrier === "noda" &&
2445
- base.final.idiom?.kind === "conjecture" &&
2446
- base.final.idiom.conjecturePolite === true);
2447
- const politeSuffix = connectivePolite ? "요" : "";
2448
- if (connectiveSurface === "から" || connectiveSurface === "ので") {
2449
- return { ok: true, text: `${base.prefix}${nominal}일 테니까${politeSuffix}`, polite: connectivePolite };
2450
- }
2451
- if (isAdversativeConnectiveSurface(connectiveSurface)) {
2452
- return { ok: true, text: `${base.prefix}${nominal}이겠지만${politeSuffix}`, polite: connectivePolite };
2453
- }
2454
- if (connectiveSurface === "し" &&
2455
- base.final.idiom?.kind === "conjecture" &&
2456
- base.final.idiom.sourceLemma !== undefined) {
2457
- const hostAttr = conjugate(base.final.idiom.sourceLemma, base.final.idiom.sourceIrregular ?? null, "ㄹ/을");
2458
- const listingPoliteSuffix = isPolite ? "요" : "";
2459
- return {
2460
- ok: true,
2461
- text: `${base.prefix}${hostAttr} 테고${listingPoliteSuffix}`,
2462
- polite: isPolite
2463
- };
2464
- }
2465
- const ending = resolveConnectiveEnding(connectiveSurface, false, false);
2466
- if (ending === null || !ending.pastViaEnding) {
2467
- return { ok: false, reason: `nominalized conjecture + connective '${connectiveSurface}' 영역 외` };
2468
- }
2469
- const finalText = conjugate(`${nominal}이겠다`, null, ending.ending);
2470
- return {
2471
- ok: true,
2472
- text: `${base.prefix}${finalText}${ending.suffixText ?? ""}${politeSuffix}`,
2473
- polite: connectivePolite
2474
- };
2475
- }
2476
- export function renderConjectureQuotativeFromStem(options) {
2477
- const { stemLemma, stemIrregular, preModalNeg, past, lookups } = options;
2478
- if (preModalNeg !== null && preModalNeg.chainDepth >= 2) {
2479
- return { ok: false, reason: "chain depth ≥ 2 + conjecture quotative 영역 외" };
2480
- }
2481
- if (preModalNeg?.chainPast === true) {
2482
- return { ok: false, reason: "past negative conjecture quotative 영역 외" };
2483
- }
2484
- let future;
2485
- if (preModalNeg !== null) {
2486
- if (preModalNeg.preferShortNegation && options.isVerb) {
2487
- const [prefix, negLemma, negIrregular] = shortNegationPrefix(stemLemma, stemIrregular, lookups);
2488
- future = prefix + conjugate(negLemma, negIrregular, "ㄹ/을");
2489
- }
2490
- else {
2491
- future = `${conjugate(stemLemma, stemIrregular, "지")} ${conjugate("않다", null, "ㄹ/을")}`;
2492
- }
2493
- }
2494
- else if (past) {
2495
- future = conjugate(`${conjugate(stemLemma, stemIrregular, "았/었")}다`, null, "ㄹ/을");
2496
- }
2497
- else {
2498
- future = conjugate(stemLemma, stemIrregular, "ㄹ/을");
2499
- }
2500
- return {
2501
- ok: true,
2502
- text: `${future} 거라고`,
2503
- polite: false
2504
- };
2505
- }
2506
- function nounCopulaPlainQuoteText(base, past, preNeg, particle = "이라고/라고") {
2507
- if (preNeg !== null ||
2508
- past ||
2509
- (base.final.kind !== "nounCopula" && base.final.kind !== "boundNounCopula")) {
2510
- return null;
2511
- }
2512
- return `${base.prefix}${base.final.nounSurface}${selectParticle(nounCopulaFinalAllomorphHost(base.final), particle)}`;
2513
- }
2514
- function composeBaseWithQuotative(base, past, preNeg, formal, lookups, options, connective) {
2515
- if (connective?.quoteBoundary?.koreanClauseForm === "다는 말을") {
2516
- const clause = projectBaseCognitiveComplementClause(base, past, false, lookups);
2517
- if (clause !== null) {
2518
- return { ok: true, text: `${clause} 말을`, polite: false };
2519
- }
2520
- }
2521
- const nominalQuote = nounCopulaPlainQuoteText(base, past, preNeg, connective?.quoteBoundary?.nominalRoleParticle);
2522
- if (nominalQuote !== null) {
2523
- return { ok: true, text: nominalQuote, polite: false };
2524
- }
2525
- const quoteFormal = base.final.kind === "lemma" && base.final.idiom?.kind === "conjecture"
2526
- ? formal
2527
- : true;
2528
- const rendered = composeBaseWithTerminalChain(base, preNeg, past, quoteFormal, false, lookups, options);
2529
- if (!rendered.ok) {
2530
- return rendered;
2531
- }
2532
- return { ok: true, text: quotePlainDeclarative(rendered.text, { ...copularQuoteOption(base) }), polite: false };
2533
- }
2534
- export function applyQuoteBoundaryFocus(rendered, focusParticle) {
2535
- if (!rendered.ok || focusParticle === undefined) {
2536
- return rendered;
2537
- }
2538
- const focus = focusParticle === "でも"
2539
- ? selectParticle(rendered.text, "이라도/라도")
2540
- : focusParticle === "さえ" ? "조차" : focusParticle === "も" ? "도" : "는";
2541
- return {
2542
- ...rendered,
2543
- text: `${rendered.text}${focus}`
2544
- };
2545
- }
2546
- export function applyRequestComplementQuoteFocus(rendered, connectiveOrSurface) {
2547
- if (typeof connectiveOrSurface === "string") {
2548
- return rendered;
2549
- }
2550
- const boundary = connectiveOrSurface.quoteBoundary;
2551
- if (boundary === undefined) {
2552
- return rendered;
2553
- }
2554
- return boundary.koreanClauseForm === "달라는 말을"
2555
- ? applyNominalQuoteObjectFocus(rendered, boundary.focusParticle)
2556
- : applyQuoteBoundaryFocus(rendered, boundary.focusParticle);
2557
- }
2558
- export function applyNominalQuoteObjectFocus(rendered, focusParticle) {
2559
- if (!rendered.ok || focusParticle === undefined || !rendered.text.endsWith("을")) {
2560
- return rendered;
2561
- }
2562
- const head = rendered.text.slice(0, -"을".length);
2563
- const focus = focusParticle === "でも"
2564
- ? selectParticle(head, "이라도/라도")
2565
- : focusParticle === "も" ? "도" : selectParticle(head, "은/는");
2566
- return {
2567
- ...rendered,
2568
- text: `${head}${focus}`
2569
- };
2570
- }
2571
- function composeBaseWithCognitiveComplement(base, connective, past, preNeg, formal, lookups, options) {
2572
- const chainDepth = preNeg?.chainDepth ?? 0;
2573
- const effectivePast = past || (preNeg?.chainPast ?? false);
2574
- const loweredBase = chainDepth >= 1
2575
- ? applyExternalNegationDepthToPredicateBase(base, chainDepth, formal, options)
2576
- : base;
2577
- if (loweredBase === null) {
2578
- return { ok: false, reason: "cognitive complement chain lowering not supported" };
2579
- }
2580
- const clause = projectBaseCognitiveComplementClause(loweredBase, effectivePast, formal, lookups);
2581
- if (clause === null) {
2582
- return { ok: false, reason: "cognitive complement projection not supported" };
2583
- }
2584
- return { ok: true, text: `${clause} ${connective.cognitiveComplementParticle === "topic" ? "것은" : "것을"}`, polite: false };
2585
- }
2586
- function projectBaseCognitiveComplementClause(base, past, formal, lookups) {
2587
- if (base.final.kind === "negativeNounCopula") {
2588
- const lowered = negativeNounCopulaChainBase(base.final, formal);
2589
- return projectBaseCognitiveComplementClause({ prefix: `${base.prefix}${lowered.prefix}`, final: lowered.final }, past, formal, lookups);
2590
- }
2591
- if (base.final.kind === "nounCopula" || base.final.kind === "boundNounCopula") {
2592
- const noun = base.final.nounSurface;
2593
- const host = nounCopulaFinalAllomorphHost(base.final);
2594
- if (past) {
2595
- const pastStem = hasBatchim(host) ? `${noun}이었다` : `${noun}였다`;
2596
- return `${base.prefix}${pastStem}는`;
2597
- }
2598
- return `${base.prefix}${noun}${selectParticle(host, "이라는/라는")}`;
2599
- }
2600
- const rendered = composeBaseWithTerminalChain(base, null, past, true, false, lookups);
2601
- if (!rendered.ok) {
2602
- return null;
2603
- }
2604
- const text = rendered.text;
2605
- if (text.endsWith("아니다")) {
2606
- return `${text.slice(0, -"아니다".length)}아니라는`;
2607
- }
2608
- if (text.endsWith("이다")) {
2609
- const stem = text.slice(0, -"이다".length);
2610
- return `${stem}${selectParticle(stem, "이라는/라는")}`;
2611
- }
2612
- return `${text}는`;
2613
- }
2614
- export function composeBaseWithRequestComplement(base, past, preNeg, options, connectiveOrSurface = "と") {
2615
- return applyRequestComplementQuoteFocus(composeBaseWithRequestComplementBody(base, past, preNeg, options, connectiveOrSurface), connectiveOrSurface);
2616
- }
2617
- function composeBaseWithRequestComplementBody(base, past, preNeg, options, connectiveOrSurface = "と") {
2618
- const surface = typeof connectiveOrSurface === "string"
2619
- ? connectiveOrSurface
2620
- : connectiveOrSurface.surface;
2621
- const nominalRequest = typeof connectiveOrSurface === "string"
2622
- ? false
2623
- : connectiveOrSurface.quoteBoundary?.koreanClauseForm === "달라는 말을";
2624
- if (surface === "かと" && base.policy?.kind === "benefactive" && base.policy.requestComplementBase !== undefined) {
2625
- return composeBaseWithRequestComplementBody(base.policy.requestComplementBase, false, null, options, connectiveOrSurface);
2626
- }
2627
- if (base.policy?.kind === "desire" && base.policy.requestComplementBase !== undefined) {
2628
- if (base.policy.requestComplementMode === "prohibition") {
2629
- return composeRequestProhibitionComplementBody(base.policy.requestComplementBase, connectiveOrSurface);
2630
- }
2631
- if (preNeg !== null) {
2632
- if (preNeg.chainDepth !== 1 || preNeg.chainPast) {
2633
- return { ok: false, reason: "request complement supports only single non-past negative desire request" };
2634
- }
2635
- return composeRequestProhibitionComplementBody(base.policy.requestComplementBase, connectiveOrSurface);
2636
- }
2637
- return composeBaseWithRequestComplementBody(base.policy.requestComplementBase, false, null, options, connectiveOrSurface);
2638
- }
2639
- if (base.final.kind === "nounCopula") {
2640
- if (past || preNeg !== null) {
2641
- return { ok: false, reason: "noun copula request complement supports only plain non-past" };
2642
- }
2643
- const quoted = nounCopulaConnective(base.final.nounSurface, "다고", false, nounCopulaFinalAllomorphHost(base.final));
2644
- return {
2645
- ok: true,
2646
- text: concatPredicatePrefix(base.prefix, nominalRequest ? `${quoted.slice(0, -"고".length)}는 말을` : quoted),
2647
- polite: false
2648
- };
2649
- }
2650
- if (base.final.kind !== "lemma") {
2651
- return { ok: false, reason: "request complement on non-lemma base not supported" };
2652
- }
2653
- if (past) {
2654
- return { ok: false, reason: "past + request complement not supported" };
2655
- }
2656
- const effectivePreNeg = surface === "かと" && preNeg?.chainDepth === 1 && !preNeg.chainPast
2657
- ? null
2658
- : preNeg;
2659
- if (effectivePreNeg !== null) {
2660
- if (effectivePreNeg.chainDepth !== 1 || effectivePreNeg.chainPast) {
2661
- return { ok: false, reason: "request complement supports only single non-past negative request" };
2662
- }
2663
- const head = conjugate(base.final.lemma, base.final.irregular, "지");
2664
- return {
2665
- ok: true,
2666
- text: `${base.prefix}${head} 말아 ${nominalRequest ? "달라는 말을" : "달라고"}`,
2667
- polite: false
2668
- };
2669
- }
2670
- const lowered = applyNegationChainToLemmaBase(base, effectivePreNeg, options);
2671
- if (lowered === null || lowered.final.kind !== "lemma") {
2672
- return { ok: false, reason: "request complement lowering not supported" };
2673
- }
2674
- const head = conjugate(lowered.final.lemma, lowered.final.irregular, "아/어");
2675
- const requestBody = nominalRequest
2676
- ? normalizeRequestQuoteNominal(head, lowered.final.lemma)
2677
- : normalizeRequestQuotative(head, lowered.final.lemma);
2678
- return {
2679
- ok: true,
2680
- text: concatPredicatePrefix(lowered.prefix, requestBody),
2681
- polite: false
2682
- };
2683
- }
2684
- export function composeBaseWithRequestAttributiveQuote(base, past, preNeg, options) {
2685
- if (base.policy?.kind === "desire" && base.policy.requestComplementBase !== undefined) {
2686
- if (base.policy.requestComplementMode === "prohibition") {
2687
- return composeRequestProhibitionAttributiveQuote(base.policy.requestComplementBase);
2688
- }
2689
- if (preNeg !== null) {
2690
- if (preNeg.chainDepth !== 1 || preNeg.chainPast) {
2691
- return { ok: false, reason: "request attributive quote supports only single non-past negative desire request" };
2692
- }
2693
- return composeRequestProhibitionAttributiveQuote(base.policy.requestComplementBase);
2694
- }
2695
- return composeBaseWithRequestAttributiveQuote(base.policy.requestComplementBase, false, null, options);
2696
- }
2697
- if (base.final.kind !== "lemma") {
2698
- return { ok: false, reason: "request attributive quote on non-lemma base not supported" };
2699
- }
2700
- if (past) {
2701
- return { ok: false, reason: "past + request attributive quote not supported" };
2702
- }
2703
- if (preNeg !== null) {
2704
- if (preNeg.chainDepth !== 1 || preNeg.chainPast) {
2705
- return { ok: false, reason: "request attributive quote supports only single non-past negative request" };
2706
- }
2707
- const head = conjugate(base.final.lemma, base.final.irregular, "지");
2708
- return {
2709
- ok: true,
2710
- text: `${base.prefix}${head} 말아 달라는`,
2711
- polite: false
2712
- };
2713
- }
2714
- const lowered = applyNegationChainToLemmaBase(base, null, options);
2715
- if (lowered === null || lowered.final.kind !== "lemma") {
2716
- return { ok: false, reason: "request attributive quote lowering not supported" };
2717
- }
2718
- const head = conjugate(lowered.final.lemma, lowered.final.irregular, "아/어");
2719
- const mainText = concatPredicatePrefix(lowered.prefix, head);
2720
- const trace = options.trace;
2721
- if (trace === undefined) {
2722
- const recipe = requestQuoteAttributiveRecipe(mainText, lowered.final.lemma);
2723
- return { ok: true, text: recipe.text, polite: false };
2724
- }
2725
- const commandPrefix = (trace.chainSourceTrace?.prefixSegments ?? []).map((segment) => {
2726
- const { text, sourceTokens, ...metadata } = segment;
2727
- return { text, sources: sourceTokens, metadata };
2728
- });
2729
- const commandFinalSources = trace.chainSourceTrace?.finalSourceTokens ?? trace.stemTokens ?? [];
2730
- const commandFinalMetadata = trace.chainSourceTrace === undefined
2731
- ? { kind: "lexeme", projectionConfidence: "semantic" }
2732
- : { kind: trace.chainSourceTrace.finalKind, projectionConfidence: "semantic" };
2733
- const commandTokens = trace.commandTokens ?? [
2734
- ...commandPrefix.flatMap(({ sources }) => sources),
2735
- ...commandFinalSources
2736
- ];
2737
- const recipe = requestQuoteAttributiveRecipe(mainText, lowered.final.lemma, {
2738
- commandSources: commandTokens,
2739
- commandPrefix,
2740
- commandFinalSources,
2741
- commandFinalMetadata,
2742
- requestSources: trace.requestTokens,
2743
- carrierSources: trace.carrierTokens
2744
- });
2745
- const predicateTrace = recipe.predicate.segments.map((segment) => ({
2746
- ...segment.metadata,
2747
- text: segment.text,
2748
- sourceTokens: segment.sources
2749
- }));
2750
- return {
2751
- ok: true,
2752
- text: recipe.text,
2753
- polite: false,
2754
- traced: tracedCat(predicateTrace, tracedSeg(recipe.request.text, recipe.request.sources, "aux", "semantic"), tracedSeg(recipe.carrier.text, recipe.carrier.sources, "connective", "semantic"))
2755
- };
2756
- }
2757
- export function isRequestComplementLikeConnective(connective) {
2758
- return connective.connective === "request_complement" ||
2759
- connective.quoteBoundary?.koreanClauseForm === "달라고" ||
2760
- connective.quoteBoundary?.koreanClauseForm === "달라는 말을";
2761
- }
2762
- export function composeRequestProhibitionComplement(base, connectiveOrSurface, options = {}) {
2763
- return applyRequestComplementQuoteFocus(composeRequestProhibitionComplementBody(base, connectiveOrSurface, options), connectiveOrSurface);
2764
- }
2765
- function composeRequestProhibitionComplementBody(base, connectiveOrSurface, options = {}) {
2766
- const nominalRequest = typeof connectiveOrSurface === "string"
2767
- ? false
2768
- : connectiveOrSurface.quoteBoundary?.koreanClauseForm === "달라는 말을";
2769
- if (base.final.kind !== "lemma") {
2770
- return { ok: false, reason: "prohibition request complement on non-lemma base not supported" };
2771
- }
2772
- const head = conjugate(base.final.lemma, base.final.irregular, "지");
2773
- const requestForm = options.requestForm !== false;
2774
- const body = requestForm
2775
- ? `${head} 말아 ${nominalRequest ? "달라는 말을" : "달라고"}`
2776
- : `${head} ${nominalRequest ? "말라는 말을" : `말라${options.complementizer ?? "고"}`}`;
2777
- return {
2778
- ok: true,
2779
- text: concatPredicatePrefix(base.prefix, body),
2780
- polite: false
2781
- };
2782
- }
2783
- export function composeRequestProhibitionAttributiveQuote(base, options = {}) {
2784
- if (base.final.kind !== "lemma") {
2785
- return { ok: false, reason: "prohibition request attributive quote on non-lemma base not supported" };
2786
- }
2787
- const head = conjugate(base.final.lemma, base.final.irregular, "지");
2788
- const requestForm = options.requestForm !== false;
2789
- const text = concatPredicatePrefix(base.prefix, requestForm ? `${head} 말아 달라는` : `${head} 말라는`);
2790
- if (options.trace !== undefined && base.prefix.length === 0) {
2791
- const trace = options.trace;
2792
- return {
2793
- ok: true,
2794
- text,
2795
- polite: false,
2796
- traced: tracedCat(tracedSeg(head, [...trace.stemTokens, ...trace.negativeTokens], "lexeme", "semantic"), tracedSeg(requestForm ? " 말아" : " 말", trace.bridgeTokens, "aux", "semantic"), requestForm ? tracedSeg(" 달", trace.requestTailTokens, "aux", "semantic") : [], tracedSeg("라는", trace.carrierTokens, "connective", "semantic"))
2797
- };
2798
- }
2799
- return { ok: true, text, polite: false };
2800
- }
2801
- function composeBaseWithReformulation(base, connective, past, preNeg, lookups, options) {
2802
- const nominalQuote = nounCopulaPlainQuoteText(base, past, preNeg);
2803
- if (nominalQuote !== null) {
2804
- const nominalText = quotedDeclarativeToReformulation(nominalQuote);
2805
- return { ok: true, text: `${nominalText}${connectiveFocusParticleSuffix(connective.surface, nominalText)}`, polite: false };
2806
- }
2807
- const rendered = composeBaseWithTerminalChain(base, preNeg, past, true, false, lookups, options);
2808
- if (!rendered.ok) {
2809
- return rendered;
2810
- }
2811
- const text = quotedDeclarativeToReformulation(quotePlainDeclarative(rendered.text, { ...copularQuoteOption(base) }));
2812
- return { ok: true, text: `${text}${connectiveFocusParticleSuffix(connective.surface, text)}`, polite: false };
2813
- }
2814
1372
  function composeBaseWithQuotedConcessive(base, connective, past, preNeg, formal, lookups, options) {
2815
1373
  const suffix = quotedConcessiveSuffix(connective.surface);
2816
1374
  if (suffix === null) {
@@ -2850,94 +1408,6 @@ function quotedConcessiveSuffix(surface) {
2850
1408
  }
2851
1409
  return null;
2852
1410
  }
2853
- function composeBaseWithRetrospectiveQuotative(base, connective, past, preNeg, formal, lookups, options) {
2854
- if (connective.retrospectiveQuotativeFlavor === "question_retrospective" &&
2855
- preNeg === null &&
2856
- isNounCopulaProjectableBase(base)) {
2857
- return {
2858
- ok: true,
2859
- text: `${composeNounCopulaConjectureQuestion(base, past, formal, false)} 싶더니`,
2860
- polite: false
2861
- };
2862
- }
2863
- const rendered = composeBaseWithTerminalChain(base, preNeg, past, true, false, lookups, options);
2864
- if (!rendered.ok) {
2865
- return rendered;
2866
- }
2867
- const quote = quotePlainDeclarative(rendered.text, { ...copularQuoteOption(base) });
2868
- if (connective.retrospectiveQuotativeFlavor === "question_retrospective") {
2869
- return { ok: true, text: quotedDeclarativeToChangeOfState(quote), polite: false };
2870
- }
2871
- if (connective.retrospectiveQuotativeFlavor === "direct_thought") {
2872
- return { ok: true, text: `${quote} 생각했더니`, polite: false };
2873
- }
2874
- return { ok: false, reason: "retrospective quotative flavor is missing" };
2875
- }
2876
- function composeBaseWithQuestionReformulation(base, past, preNeg, lookups, options) {
2877
- if (!past && preNeg === null && base.final.kind === "nounCopula" && base.final.adverbialNominalFallback === true) {
2878
- const adverbial = `${base.final.nounSurface}${selectParticle(nounCopulaFinalAllomorphHost(base.final), "이라/라")}`;
2879
- return { ok: true, text: `${base.prefix}${adverbial} 하면`, polite: false };
2880
- }
2881
- const chainDepth = preNeg?.chainDepth ?? 0;
2882
- const questionBase = chainDepth === 0
2883
- ? base
2884
- : applyExternalNegationDepthToPredicateBase(base, chainDepth, true, negationLoweringOptionsWithOpFocus(preNeg, options));
2885
- if (questionBase === null) {
2886
- return { ok: false, reason: "question reformulation chain lowering not supported" };
2887
- }
2888
- const question = composePlainSelfQuestionTerminal(questionBase, past || (preNeg?.chainPast ?? false), lookups);
2889
- return { ok: true, text: `${question} 하면`, polite: false };
2890
- }
2891
- function composeBaseWithWishComplement(base, past, preNeg, formal, options) {
2892
- const chainDepth = preNeg?.chainDepth ?? 0;
2893
- const effectivePast = past || (preNeg?.chainPast ?? false);
2894
- const loweredBase = chainDepth >= 1
2895
- ? applyExternalNegationDepthToPredicateBase(base, chainDepth, formal, options)
2896
- : base;
2897
- if (loweredBase === null) {
2898
- return { ok: false, reason: "wish complement chain lowering not supported" };
2899
- }
2900
- const nominalized = projectBaseNominalized(loweredBase, effectivePast, formal);
2901
- if (nominalized === null) {
2902
- return { ok: false, reason: "wish complement nominalization not supported" };
2903
- }
2904
- return {
2905
- ok: true,
2906
- text: `${nominalized}${selectParticle(nominalized, "을/를")}`,
2907
- polite: false
2908
- };
2909
- }
2910
- export function projectBaseNominalized(base, past, formal) {
2911
- if (base.final.kind === "negativeNounCopula") {
2912
- const lowered = negativeNounCopulaChainBase(base.final, formal);
2913
- return projectBaseNominalized({ prefix: `${base.prefix}${lowered.prefix}`, final: lowered.final }, past, formal);
2914
- }
2915
- if (base.final.kind === "nounCopula" || base.final.kind === "boundNounCopula") {
2916
- const noun = base.final.nounSurface;
2917
- if (past) {
2918
- const stem = hasBatchim(nounCopulaFinalAllomorphHost(base.final)) ? `${noun}이었` : `${noun}였`;
2919
- return `${base.prefix}${stem}기`;
2920
- }
2921
- return `${base.prefix}${noun}이기`;
2922
- }
2923
- const final = base.final;
2924
- if (past) {
2925
- const stem = final.lemma === "아니다"
2926
- ? "아니었"
2927
- : conjugate(final.lemma, final.irregular, "았/었");
2928
- return `${base.prefix}${stem}기`;
2929
- }
2930
- return `${base.prefix}${conjugate(final.lemma, final.irregular, "기")}`;
2931
- }
2932
- function quotedDeclarativeToReformulation(text) {
2933
- return text.endsWith("고") ? `${text.slice(0, -1)}기보다` : `${text}기보다`;
2934
- }
2935
- function isNounCopulaProjectableBase(base) {
2936
- return base.final.kind === "nounCopula" || base.final.kind === "negativeNounCopula";
2937
- }
2938
- function quotedDeclarativeToChangeOfState(text) {
2939
- return text.endsWith("고") ? `${text.slice(0, -1)} 싶더니` : `${text} 싶더니`;
2940
- }
2941
1411
  export function composeNounCopulaConnective(prefix, nounSurface, connective, past, isPolite, formal, preservesSourcePoliteness = false, allomorphHost, copulaFusedSurface) {
2942
1412
  const host = allomorphHost ?? nounSurface;
2943
1413
  const politeSuffix = isPolite && !(formal && connective.connective === "adversative") ? "요" : "";
@@ -3053,53 +1523,3 @@ export function composeNounCopulaConnective(prefix, nounSurface, connective, pas
3053
1523
  polite: isPolite
3054
1524
  };
3055
1525
  }
3056
- function resolveConnectiveEnding(surface, isVerb, past) {
3057
- const rule = CONNECTIVE_RENDER_MAP.get(surface);
3058
- if (rule === undefined)
3059
- return null;
3060
- if (rule.pastBehavior === "ignore" || rule.pastBehavior === "natural") {
3061
- const ending = !isVerb && rule.adjEnding !== undefined ? rule.adjEnding : rule.korean;
3062
- return { ending, pastViaEnding: true, ...(rule.suffixText === undefined ? {} : { suffixText: rule.suffixText }) };
3063
- }
3064
- if (past) {
3065
- const adjPast = !isVerb ? (rule.adjPastEnding ?? rule.pastEnding) : rule.pastEnding;
3066
- if (adjPast !== undefined) {
3067
- return { ending: adjPast, pastViaEnding: true, ...(rule.suffixText === undefined ? {} : { suffixText: rule.suffixText }) };
3068
- }
3069
- const baseAdj = !isVerb && rule.adjEnding !== undefined ? rule.adjEnding : rule.korean;
3070
- return { ending: baseAdj, pastViaEnding: false, ...(rule.suffixText === undefined ? {} : { suffixText: rule.suffixText }) };
3071
- }
3072
- const ending = !isVerb && rule.adjEnding !== undefined ? rule.adjEnding : rule.korean;
3073
- return { ending, pastViaEnding: true, ...(rule.suffixText === undefined ? {} : { suffixText: rule.suffixText }) };
3074
- }
3075
- function connectiveRenderSurface(connective) {
3076
- if (connective.source.tokens.some(isConditionalNaraAuxToken)) {
3077
- return "なら";
3078
- }
3079
- if (connective.source.tokens.some((token) => isPastAuxConditionalForm(token.pos))) {
3080
- return canonicalMedialProlongationConnectiveSurface(connective.surface);
3081
- }
3082
- return connective.surface;
3083
- }
3084
- function isConditionalNaraAuxToken(token) {
3085
- return token.dictionaryForm === "だ" &&
3086
- token.reading === "ナラ" &&
3087
- (token.pos & (POS4 | POS5A)) === (助動詞_ダ | 仮定形_);
3088
- }
3089
- export const CONDITIONAL_QUOTE_ELLIPSIS_PREDICATE = {
3090
- wish: { lemma: "좋겠다", declarative: "좋겠다" },
3091
- sufficiency: { lemma: "되다", declarative: "된다" }
3092
- };
3093
- export function composeConditionalQuoteEllipsisAttributive(renderedConditional, mood, requiresFutureAttributive) {
3094
- if (!renderedConditional.ok) {
3095
- return renderedConditional;
3096
- }
3097
- const predicate = CONDITIONAL_QUOTE_ELLIPSIS_PREDICATE[mood];
3098
- return {
3099
- ...renderedConditional,
3100
- text: `${renderedConditional.text} ${requiresFutureAttributive
3101
- ? conjugate(predicate.lemma, null, "ㄹ/을")
3102
- : plainDeclarativeToPointAttributive(predicate.declarative)}`,
3103
- polite: false
3104
- };
3105
- }