calliope-ts 0.0.2 → 0.0.3

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 (159) hide show
  1. package/README.md +3 -13
  2. package/dist/caesura.d.ts +33 -0
  3. package/dist/caesura.d.ts.map +1 -0
  4. package/dist/caesura.js +202 -0
  5. package/dist/calliope/boundaries.d.ts +19 -0
  6. package/dist/calliope/boundaries.d.ts.map +1 -0
  7. package/dist/calliope/boundaries.js +182 -0
  8. package/dist/calliope/bracketing.d.ts +11 -0
  9. package/dist/calliope/bracketing.d.ts.map +1 -0
  10. package/dist/calliope/bracketing.js +416 -0
  11. package/dist/calliope/deps.d.ts +4 -0
  12. package/dist/calliope/deps.d.ts.map +1 -0
  13. package/dist/calliope/deps.js +181 -0
  14. package/dist/calliope/engine.d.ts +3 -0
  15. package/dist/calliope/engine.d.ts.map +1 -0
  16. package/dist/calliope/engine.js +71 -0
  17. package/dist/calliope/feats.d.ts +9 -0
  18. package/dist/calliope/feats.d.ts.map +1 -0
  19. package/dist/calliope/feats.js +45 -0
  20. package/dist/calliope/names.d.ts +7 -0
  21. package/dist/calliope/names.d.ts.map +1 -0
  22. package/dist/calliope/names.js +42 -0
  23. package/dist/calliope/postag.d.ts +8 -0
  24. package/dist/calliope/postag.d.ts.map +1 -0
  25. package/dist/calliope/postag.js +250 -0
  26. package/dist/calliope/prosodic.d.ts +3 -0
  27. package/dist/calliope/prosodic.d.ts.map +1 -0
  28. package/dist/calliope/prosodic.js +275 -0
  29. package/dist/calliope/relstress.d.ts +4 -0
  30. package/dist/calliope/relstress.d.ts.map +1 -0
  31. package/dist/calliope/relstress.js +688 -0
  32. package/dist/calliope/stressrules.d.ts +28 -0
  33. package/dist/calliope/stressrules.d.ts.map +1 -0
  34. package/dist/calliope/stressrules.js +147 -0
  35. package/dist/calliope/syntax.d.ts +38 -0
  36. package/dist/calliope/syntax.d.ts.map +1 -0
  37. package/dist/calliope/syntax.js +234 -0
  38. package/dist/calliope/udpos.d.ts +13 -0
  39. package/dist/calliope/udpos.d.ts.map +1 -0
  40. package/dist/calliope/udpos.js +156 -0
  41. package/dist/clio/caesura.d.ts +27 -0
  42. package/dist/clio/caesura.d.ts.map +1 -0
  43. package/dist/clio/caesura.js +148 -0
  44. package/dist/clio/depfix.d.ts +13 -0
  45. package/dist/clio/depfix.d.ts.map +1 -0
  46. package/dist/clio/depfix.js +84 -0
  47. package/dist/clio/display.d.ts +32 -0
  48. package/dist/clio/display.d.ts.map +1 -0
  49. package/dist/clio/display.js +976 -0
  50. package/dist/clio/engine.d.ts +3 -0
  51. package/dist/clio/engine.d.ts.map +1 -0
  52. package/dist/clio/engine.js +28 -0
  53. package/dist/clio/parser.d.ts +10 -0
  54. package/dist/clio/parser.d.ts.map +1 -0
  55. package/dist/clio/parser.js +696 -0
  56. package/dist/clio/phonological.d.ts +41 -0
  57. package/dist/clio/phonological.d.ts.map +1 -0
  58. package/dist/clio/phonological.js +788 -0
  59. package/dist/clio/phrasestress.d.ts +6 -0
  60. package/dist/clio/phrasestress.d.ts.map +1 -0
  61. package/dist/clio/phrasestress.js +106 -0
  62. package/dist/clio/pipeline.d.ts +11 -0
  63. package/dist/clio/pipeline.d.ts.map +1 -0
  64. package/dist/clio/pipeline.js +147 -0
  65. package/dist/clio/rhyme.d.ts +65 -0
  66. package/dist/clio/rhyme.d.ts.map +1 -0
  67. package/dist/clio/rhyme.js +761 -0
  68. package/dist/clio/scandroid.d.ts +17 -0
  69. package/dist/clio/scandroid.d.ts.map +1 -0
  70. package/dist/clio/scandroid.js +435 -0
  71. package/dist/clio/scansion.d.ts +46 -0
  72. package/dist/clio/scansion.d.ts.map +1 -0
  73. package/dist/clio/scansion.js +1086 -0
  74. package/dist/clio/semantics.d.ts +44 -0
  75. package/dist/clio/semantics.d.ts.map +1 -0
  76. package/dist/clio/semantics.js +139 -0
  77. package/dist/clio/stress.d.ts +83 -0
  78. package/dist/clio/stress.d.ts.map +1 -0
  79. package/dist/clio/stress.js +1737 -0
  80. package/dist/clio/tagfix.d.ts +6 -0
  81. package/dist/clio/tagfix.d.ts.map +1 -0
  82. package/dist/clio/tagfix.js +101 -0
  83. package/dist/display.d.ts +0 -6
  84. package/dist/display.d.ts.map +1 -1
  85. package/dist/display.js +322 -141
  86. package/dist/engine.d.ts +9 -0
  87. package/dist/engine.d.ts.map +1 -0
  88. package/dist/engine.js +12 -0
  89. package/dist/index.d.ts +4 -3
  90. package/dist/index.d.ts.map +1 -1
  91. package/dist/index.js +169 -26
  92. package/dist/parser.d.ts +3 -3
  93. package/dist/parser.d.ts.map +1 -1
  94. package/dist/parser.js +320 -563
  95. package/dist/phonological.d.ts +1 -1
  96. package/dist/phonological.d.ts.map +1 -1
  97. package/dist/phonological.js +73 -4
  98. package/dist/phrasestress.d.ts +6 -0
  99. package/dist/phrasestress.d.ts.map +1 -0
  100. package/dist/phrasestress.js +106 -0
  101. package/dist/rhyme.d.ts +40 -1
  102. package/dist/rhyme.d.ts.map +1 -1
  103. package/dist/rhyme.js +435 -7
  104. package/dist/scansion.d.ts +9 -0
  105. package/dist/scansion.d.ts.map +1 -1
  106. package/dist/scansion.js +145 -18
  107. package/dist/semantics.d.ts +44 -0
  108. package/dist/semantics.d.ts.map +1 -0
  109. package/dist/semantics.js +139 -0
  110. package/dist/stress.d.ts +127 -4
  111. package/dist/stress.d.ts.map +1 -1
  112. package/dist/stress.js +834 -61
  113. package/dist/types.d.ts +15 -0
  114. package/dist/types.d.ts.map +1 -1
  115. package/package.json +5 -3
  116. package/src/caesura.ts +201 -0
  117. package/src/calliope/boundaries.ts +190 -0
  118. package/src/calliope/bracketing.ts +390 -0
  119. package/src/calliope/deps.ts +160 -0
  120. package/src/calliope/engine.ts +77 -0
  121. package/src/calliope/feats.ts +46 -0
  122. package/src/calliope/names.ts +44 -0
  123. package/src/calliope/postag.ts +253 -0
  124. package/src/calliope/prosodic.ts +262 -0
  125. package/src/calliope/relstress.ts +645 -0
  126. package/src/calliope/stressrules.ts +147 -0
  127. package/src/calliope/syntax.ts +218 -0
  128. package/src/calliope/udpos.ts +152 -0
  129. package/src/clio/caesura.ts +145 -0
  130. package/src/clio/depfix.ts +88 -0
  131. package/src/clio/display.ts +1042 -0
  132. package/src/clio/engine.ts +38 -0
  133. package/src/clio/parser.ts +845 -0
  134. package/src/clio/phonological.ts +849 -0
  135. package/src/clio/phrasestress.ts +108 -0
  136. package/src/clio/pipeline.ts +154 -0
  137. package/src/clio/rhyme.ts +740 -0
  138. package/src/clio/scandroid.ts +434 -0
  139. package/src/clio/scansion.ts +1130 -0
  140. package/src/clio/semantics.ts +134 -0
  141. package/src/clio/stress.ts +1731 -0
  142. package/src/clio/tagfix.ts +104 -0
  143. package/src/display.ts +321 -137
  144. package/src/engine.ts +22 -0
  145. package/src/index.ts +176 -32
  146. package/src/parser.ts +346 -682
  147. package/src/phonological.ts +72 -4
  148. package/src/phrasestress.ts +108 -0
  149. package/src/rhyme.ts +428 -8
  150. package/src/scansion.ts +136 -15
  151. package/src/semantics.ts +134 -0
  152. package/src/stress.ts +794 -64
  153. package/src/types.ts +39 -4
  154. package/tests/DataForHayesLinesOnly.txt +364 -0
  155. package/tests/DataForHayesStressSymbolsRevised.txt +728 -0
  156. package/tests/basic.test.ts +443 -37
  157. package/tests/bench-hayes.mjs +72 -0
  158. package/tests/wagner-stress.test.ts +188 -0
  159. package/vitest.config.ts +0 -15
@@ -0,0 +1,44 @@
1
+ import { ClsWord } from '../types.js';
2
+ /**
3
+ * A STRANDED preposition: an IN preposition whose complement has been extracted
4
+ * (wh-movement / relativisation / topicalisation), so it governs no object and
5
+ * sits clause-finally — "what are you waiting FOR", "…what you stare AT". Such
6
+ * a preposition bears stress (it is not the reducible proclitic of "in the
7
+ * house"). Conservative: IN only (infinitival TO is excluded — "I want to go"
8
+ * is not stranding), no dependent, and clause-final (the canonical strand site).
9
+ */
10
+ export declare function isStrandedPreposition(word: ClsWord, words: ClsWord[]): boolean;
11
+ /**
12
+ * A CONTRASTIVE possessive: a possessive determiner (PRP$: thy/my/your/her…)
13
+ * in the elliptical contrast frame "X's … not/but MINE" — the contrast lifts
14
+ * the possessor out of reduction ("it was THY choice, not mine"). Tight by
15
+ * construction: requires a contrast marker (not/but/nor) adjacent to an
16
+ * absolute possessive somewhere in the clause, so an ordinary unfocused
17
+ * possessive ("I lost my way") is left alone.
18
+ */
19
+ export declare function isContrastivePossessive(word: ClsWord, words: ClsWord[]): boolean;
20
+ /**
21
+ * A fronted DEICTIC LOCATIVE "there"/"here" in locative inversion — "THERE
22
+ * could I marvel", "HERE could I rest". FinNLP mis-tags the fronted locative
23
+ * as existential (EX / expl) or reduces it as a discourse adverb, flattening it
24
+ * to 'w'; but a fronted locative that triggers subject-aux inversion (an
25
+ * aux/modal immediately followed by a subject pronoun) is a stressed deictic
26
+ * focus, NOT the reduced existential of "there IS a house" (no inversion) or
27
+ * the presentational "there LIVED a king" (verb + NP, no inversion).
28
+ */
29
+ export declare function isDeicticLocative(word: ClsWord, words: ClsWord[]): boolean;
30
+ /**
31
+ * Imperative clause: the ROOT is a base-form verb (VB) with no overt subject
32
+ * (no NSUBJ dependent) — "Tell me…", "Do not go…". Used by the nuclear pass:
33
+ * the accent falls on the verb / its object, not on a (dropped) subject, and an
34
+ * imperative-clause vocative is a direct address.
35
+ */
36
+ export declare function isImperativeClause(words: ClsWord[]): boolean;
37
+ /**
38
+ * A VOCATIVE (direct address): a noun tagged DISCOURSE/INTJ/DEP and set off by
39
+ * adjacent punctuation (a comma or "!"), in a clause that is imperative or
40
+ * subject-less — "Sing, O GODDESS…", "blow, BUGLE, blow". Conservative: the
41
+ * noun must be comma/!-adjacent so an ordinary argument noun is not swept in.
42
+ */
43
+ export declare function isVocative(word: ClsWord, words: ClsWord[]): boolean;
44
+ //# sourceMappingURL=semantics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantics.d.ts","sourceRoot":"","sources":["../../src/clio/semantics.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAsBtC;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,CAI9E;AAQD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,CAQhF;AAMD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,CAc1E;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,CAS5D;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,CAUnE"}
@@ -0,0 +1,139 @@
1
+ // semantics.ts — Prominence signals mined from the dependency parse + POS.
2
+ //
3
+ // Dependency roles ARE the semantic layer: NSUBJ=agent, DOBJ/IOBJ=patient/
4
+ // recipient, OBL/ADVMOD/ADVCL=peripheral, PRP$=possessor, INTJ/DISCOURSE=
5
+ // address. A flat POS floor crushes function words that these configurations
6
+ // reveal to be prominent — a STRANDED preposition ("what are you waiting FOR"),
7
+ // a CONTRASTIVE possessive ("thy choice, not mine"), a VOCATIVE. These
8
+ // detectors recover that prominence from observable structure only (no semantic
9
+ // guessing, no cross-poem givenness). They are consumed by the relativiser
10
+ // (stress.ts) as targeted floor RAISES, and by the nuclear pass (Phase 4).
11
+ import { isPunctuation } from './parser.js';
12
+ /** True if some other token has `word` as its dependency governor (i.e. word
13
+ * has a complement/dependent of its own). */
14
+ function hasDependent(word, words) {
15
+ for (const w of words) {
16
+ if (w !== word && w.dependency && w.dependency.governor === word)
17
+ return true;
18
+ }
19
+ return false;
20
+ }
21
+ /** Last non-punctuation token index in the sentence at/after `from`? */
22
+ function isClauseFinal(word, words) {
23
+ const idx = words.indexOf(word);
24
+ if (idx < 0)
25
+ return false;
26
+ for (let k = idx + 1; k < words.length; k++) {
27
+ if (!isPunctuation(words[k].lexicalClass))
28
+ return false;
29
+ }
30
+ return true;
31
+ }
32
+ /**
33
+ * A STRANDED preposition: an IN preposition whose complement has been extracted
34
+ * (wh-movement / relativisation / topicalisation), so it governs no object and
35
+ * sits clause-finally — "what are you waiting FOR", "…what you stare AT". Such
36
+ * a preposition bears stress (it is not the reducible proclitic of "in the
37
+ * house"). Conservative: IN only (infinitival TO is excluded — "I want to go"
38
+ * is not stranding), no dependent, and clause-final (the canonical strand site).
39
+ */
40
+ export function isStrandedPreposition(word, words) {
41
+ if (word.lexicalClass !== 'IN')
42
+ return false;
43
+ if (hasDependent(word, words))
44
+ return false; // has a complement → ordinary preposition
45
+ return isClauseFinal(word, words);
46
+ }
47
+ /** Absolute / elliptical possessive pronouns used as the contrasted element. */
48
+ const ABSOLUTE_POSSESSIVES = new Set([
49
+ 'mine', 'thine', 'yours', 'hers', 'ours', 'theirs', 'his',
50
+ ]);
51
+ const CONTRAST_MARKERS = new Set(['not', 'but', 'nor']);
52
+ /**
53
+ * A CONTRASTIVE possessive: a possessive determiner (PRP$: thy/my/your/her…)
54
+ * in the elliptical contrast frame "X's … not/but MINE" — the contrast lifts
55
+ * the possessor out of reduction ("it was THY choice, not mine"). Tight by
56
+ * construction: requires a contrast marker (not/but/nor) adjacent to an
57
+ * absolute possessive somewhere in the clause, so an ordinary unfocused
58
+ * possessive ("I lost my way") is left alone.
59
+ */
60
+ export function isContrastivePossessive(word, words) {
61
+ if (word.lexicalClass !== 'PRP$')
62
+ return false;
63
+ for (let i = 0; i + 1 < words.length; i++) {
64
+ const a = words[i].word.toLowerCase();
65
+ const b = words[i + 1].word.toLowerCase().replace(/['’]/g, '');
66
+ if (CONTRAST_MARKERS.has(a) && ABSOLUTE_POSSESSIVES.has(b))
67
+ return true;
68
+ }
69
+ return false;
70
+ }
71
+ /** Finite auxiliaries / modals whose appearance before a subject pronoun marks
72
+ * subject-aux inversion. */
73
+ const INVERSION_AUX = new Set(['MD', 'VBP', 'VBZ', 'VBD']);
74
+ /**
75
+ * A fronted DEICTIC LOCATIVE "there"/"here" in locative inversion — "THERE
76
+ * could I marvel", "HERE could I rest". FinNLP mis-tags the fronted locative
77
+ * as existential (EX / expl) or reduces it as a discourse adverb, flattening it
78
+ * to 'w'; but a fronted locative that triggers subject-aux inversion (an
79
+ * aux/modal immediately followed by a subject pronoun) is a stressed deictic
80
+ * focus, NOT the reduced existential of "there IS a house" (no inversion) or
81
+ * the presentational "there LIVED a king" (verb + NP, no inversion).
82
+ */
83
+ export function isDeicticLocative(word, words) {
84
+ const lemma = word.word.toLowerCase().replace(/['’]/g, '');
85
+ if (lemma !== 'there' && lemma !== 'here')
86
+ return false;
87
+ const idx = words.indexOf(word);
88
+ // must be the first non-punctuation token (fronted)
89
+ let first = -1;
90
+ for (let i = 0; i < words.length; i++) {
91
+ if (!isPunctuation(words[i].lexicalClass)) {
92
+ first = i;
93
+ break;
94
+ }
95
+ }
96
+ if (idx !== first)
97
+ return false;
98
+ // subject-aux inversion: <there/here> <aux|modal> <subject pronoun>
99
+ const aux = words[idx + 1];
100
+ const subj = words[idx + 2];
101
+ return !!(aux && subj && INVERSION_AUX.has(aux.lexicalClass) && subj.lexicalClass === 'PRP');
102
+ }
103
+ /**
104
+ * Imperative clause: the ROOT is a base-form verb (VB) with no overt subject
105
+ * (no NSUBJ dependent) — "Tell me…", "Do not go…". Used by the nuclear pass:
106
+ * the accent falls on the verb / its object, not on a (dropped) subject, and an
107
+ * imperative-clause vocative is a direct address.
108
+ */
109
+ export function isImperativeClause(words) {
110
+ const root = words.find(w => w.dependency && w.dependency.dependentType === 'root');
111
+ if (!root)
112
+ return false;
113
+ if (root.lexicalClass !== 'VB' && root.lexicalClass !== 'VBP')
114
+ return false;
115
+ for (const w of words) {
116
+ if (w.dependency && w.dependency.governor === root
117
+ && /nsubj/i.test(w.dependency.dependentType))
118
+ return false;
119
+ }
120
+ return true;
121
+ }
122
+ /**
123
+ * A VOCATIVE (direct address): a noun tagged DISCOURSE/INTJ/DEP and set off by
124
+ * adjacent punctuation (a comma or "!"), in a clause that is imperative or
125
+ * subject-less — "Sing, O GODDESS…", "blow, BUGLE, blow". Conservative: the
126
+ * noun must be comma/!-adjacent so an ordinary argument noun is not swept in.
127
+ */
128
+ export function isVocative(word, words) {
129
+ if (!/^(NN|NNS|NNP|NNPS)$/.test(word.lexicalClass))
130
+ return false;
131
+ const role = word.dependency?.dependentType ?? '';
132
+ if (!/discourse|intj|dep|vocative/i.test(role))
133
+ return false;
134
+ const idx = words.indexOf(word);
135
+ const prev = idx > 0 ? words[idx - 1] : null;
136
+ const next = idx + 1 < words.length ? words[idx + 1] : null;
137
+ const commaAdjacent = (prev && /^[,!]$/.test(prev.word)) || (next && /^[,!]$/.test(next.word));
138
+ return !!commaAdjacent && isImperativeClause(words);
139
+ }
@@ -0,0 +1,83 @@
1
+ import { ClsWord, IntonationalUnit } from '../types.js';
2
+ /** Check if a pair of words forms a left‑stressed compound. */
3
+ export declare function isLeftStressedPair(w1: string, w2: string): boolean;
4
+ /** True if `w2` is a head noun that keeps phrasal/right stress against an N1
5
+ * modifier (apple PIE, summer DAY, Fifth AVenue) — the marked right-stress
6
+ * exceptions to the otherwise fore-stressing Compound Stress Rule. */
7
+ export declare function isRightStressedHead(w2: string): boolean;
8
+ /**
9
+ * Direction of primary stress for an adjacent two-word modification structure,
10
+ * the SINGLE source of truth shared by the lexical compound pass
11
+ * (`applyCompoundStress`) and the Phrase-Stress phase (`computePhraseStress`),
12
+ * so the two layers cannot disagree.
13
+ *
14
+ * 'left' = fore-stress, primary on w1 — the Compound Stress Rule default for
15
+ * an N+N compound (Chomsky–Halle; McAleese's worked example marks
16
+ * ICE cream with primary on "ice", not "cream"): KITCHen table,
17
+ * WINdow frame, BEDroom door, plus the curated LEFT_STRESS_* sets.
18
+ * 'right' = end-stress, primary on w2 — the marked exceptions: food/temporal
19
+ * "made of N1" heads (apple PIE, summer DAY), Adj+N which is phrasal
20
+ * not compound (sweet CREAM, red CAR), and proper-name sequences
21
+ * which carry their own right-headed prosody (New YORK, John SMITH).
22
+ * null = not a compound/modification pair at all.
23
+ *
24
+ * The fore-stress default is restricted to COMMON-noun N+N: proper-noun pairs
25
+ * (NNP/NNPS) are excluded because place- and personal-name sequences are not
26
+ * reliably fore-stressed, and flipping them would mis-teach New YORK / John SMITH.
27
+ */
28
+ export declare function compoundStressSide(w1: string, pos1: string, w2: string, pos2: string): 'left' | 'right' | null;
29
+ /**
30
+ * Assign per‑syllable lexical stress to each word in a sentence.
31
+ *
32
+ * Uses the first CMU pronunciation. Function words have their
33
+ * primary stress downgraded to secondary (2 → 1).
34
+ */
35
+ export declare function assignLexicalStress(words: ClsWord[]): void;
36
+ /**
37
+ * Adjust stresses for nominal compounds.
38
+ *
39
+ * Fore-stressed by default: an N+N compound puts primary (2) on the first
40
+ * element, secondary (1) on the second — the Compound Stress Rule (Chomsky–
41
+ * Halle; McAleese marks ICE cream with primary on "ice", KITCHen table,
42
+ * WINdow frame). The marked right-stress exceptions — food/temporal "made of"
43
+ * heads (apple PIE), Adj+N phrases (sweet CREAM), and proper-name sequences
44
+ * (New YORK) — reverse it. All of this lives in `compoundStressSide`.
45
+ */
46
+ export declare function applyCompoundStress(ius: IntonationalUnit[]): void;
47
+ /** Locate the syllable with the highest stress and set it to `value`. */
48
+ export declare function setPrimaryStress(word: ClsWord, value: number): void;
49
+ /**
50
+ * Recursively assign higher stress to content words from right to left.
51
+ * Only the rightmost content word receives a boost (+1 above lexical primary).
52
+ * All other content words keep their lexical stress.
53
+ * This preserves lexical stress for meter detection while still indicating
54
+ * the nuclear accent for phonological phrasing.
55
+ */
56
+ export declare function applyNuclearStress(ius: IntonationalUnit[]): void;
57
+ /**
58
+ * Convert numeric per‑syllable stress to McAleese’s symbolic levels
59
+ * (w, n, m, s) and resolve adjacent identical stresses using dependency
60
+ * information.
61
+ */
62
+ export declare function assignRelativeStresses(words: ClsWord[], ius: IntonationalUnit[]): void;
63
+ /**
64
+ * THE CLASH FILTER — an absolute surface well-formedness constraint.
65
+ *
66
+ * On the STRESSED tier {n, m, s} no two *contiguous* syllables may carry the SAME
67
+ * level: that is a stress clash (two equal prominences with no gradation between
68
+ * them), which English categorically disallows. Gradient pairs (sm/ms/sn/ns/mn/nm)
69
+ * are fine — there is still a step down — as are runs of the unstressed tiers
70
+ * {w, x} (an unstressed sequence is tolerated, if not ideal). This generalises
71
+ * McAleese's Appendix-A step 3d-ii ("stress clashes (ss, ms) > s-s") and Liberman
72
+ * & Prince's (1977) grid alternation to every level of the strong tier.
73
+ *
74
+ * Resolution is DEMOTE-ONLY (never promote — promotion is the meter layer's job,
75
+ * McAleese Test 2), so the contour is never inflated to break a clash; we iterate
76
+ * to a fixed point (each change strictly lowers total stress mass, so it
77
+ * terminates). Which member yields is decided by `demoteRightOfClash` (grid-based
78
+ * relative prominence). Runs on the LINEAR surface order because a clash is a
79
+ * property of contiguous *pronounced* syllables (Hayes), which a mis-grouped
80
+ * dependency parse can scatter across phrases.
81
+ */
82
+ export declare function resolveLinearClashes(words: ClsWord[]): void;
83
+ //# sourceMappingURL=stress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stress.d.ts","sourceRoot":"","sources":["../../src/clio/stress.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAyB,gBAAgB,EAAsB,MAAM,aAAa,CAAC;AA2VnG,+DAA+D;AAC/D,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAelE;AAED;;uEAEuE;AACvE,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAChC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GACjD,MAAM,GAAG,OAAO,GAAG,IAAI,CASzB;AAiSD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,IAAI,CAkR1D;AAID;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,gBAAgB,EAAE,GAAG,IAAI,CA2BjE;AAED,yEAAyE;AACzE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAYnE;AAID;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAwChE;AA8CD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAsLtF;AA8FD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,IAAI,CAuB3D"}