calliope-ts 0.0.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 (50) hide show
  1. package/.claude/settings.local.json +8 -0
  2. package/.opencode/skills/calliope-ts/SKILL.md +74 -0
  3. package/LICENSE +201 -0
  4. package/README.md +485 -0
  5. package/dist/depfix.d.ts +13 -0
  6. package/dist/depfix.d.ts.map +1 -0
  7. package/dist/depfix.js +84 -0
  8. package/dist/display.d.ts +38 -0
  9. package/dist/display.d.ts.map +1 -0
  10. package/dist/display.js +890 -0
  11. package/dist/index.d.ts +50 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +504 -0
  14. package/dist/parser.d.ts +10 -0
  15. package/dist/parser.d.ts.map +1 -0
  16. package/dist/parser.js +688 -0
  17. package/dist/phonological.d.ts +41 -0
  18. package/dist/phonological.d.ts.map +1 -0
  19. package/dist/phonological.js +788 -0
  20. package/dist/rhyme.d.ts +26 -0
  21. package/dist/rhyme.d.ts.map +1 -0
  22. package/dist/rhyme.js +340 -0
  23. package/dist/scandroid.d.ts +17 -0
  24. package/dist/scandroid.d.ts.map +1 -0
  25. package/dist/scandroid.js +435 -0
  26. package/dist/scansion.d.ts +37 -0
  27. package/dist/scansion.d.ts.map +1 -0
  28. package/dist/scansion.js +1007 -0
  29. package/dist/scansion_debug.js +586 -0
  30. package/dist/stress.d.ts +32 -0
  31. package/dist/stress.d.ts.map +1 -0
  32. package/dist/stress.js +1372 -0
  33. package/dist/tagfix.d.ts +6 -0
  34. package/dist/tagfix.d.ts.map +1 -0
  35. package/dist/tagfix.js +101 -0
  36. package/dist/types.d.ts +173 -0
  37. package/dist/types.d.ts.map +1 -0
  38. package/dist/types.js +4 -0
  39. package/package.json +62 -0
  40. package/src/depfix.ts +88 -0
  41. package/src/display.ts +954 -0
  42. package/src/index.ts +541 -0
  43. package/src/parser.ts +837 -0
  44. package/src/phonological.ts +849 -0
  45. package/src/rhyme.ts +328 -0
  46. package/src/scandroid.ts +434 -0
  47. package/src/scansion.ts +1053 -0
  48. package/src/stress.ts +1381 -0
  49. package/src/tagfix.ts +104 -0
  50. package/src/types.ts +230 -0
@@ -0,0 +1,41 @@
1
+ import { ClsSentence, ClsWord, PhonologicalPhrase, IntonationalUnit, KeyStress, SyllableDisplayEntry } from './types.js';
2
+ /**
3
+ * Build the full phonological hierarchy for a sentence.
4
+ *
5
+ * 1. Split into Intonational Units at punctuation tokens.
6
+ * 2. Within each IU, build Clitic Groups by attaching function words
7
+ * to their governing content word (contiguous grouping).
8
+ * 3. Group Clitic Groups into Phonological Phrases using the phrase
9
+ * structure tree (PPs correspond to VP and PP nodes).
10
+ */
11
+ export declare function buildPhonologicalHierarchy(sentence: ClsSentence): IntonationalUnit[];
12
+ export declare function collectIUTokens(iu: IntonationalUnit): ClsWord[];
13
+ export declare function collectPPTokens(pp: PhonologicalPhrase): ClsWord[];
14
+ /**
15
+ * Render the full phonological hierarchy into the bracket notation
16
+ * used by McAleese, e.g. "<{[nm/ws\n]}mn/sw\]m]}>".
17
+ */
18
+ export declare function renderHierarchy(ius: IntonationalUnit[], words: ClsWord[]): string;
19
+ /**
20
+ * Render the key‑stress string: only syllables that participate in
21
+ * key‑stress patterns are shown with their stress symbol; all others become 'x'.
22
+ */
23
+ export declare function renderKeyStresses(ius: IntonationalUnit[], words: ClsWord[], keyStresses: KeyStress[]): string;
24
+ export type VowelLength = 'long' | 'short' | 'unknown';
25
+ /** Classify a syllable's vowel (from its ARPABET phones) as free/long vs checked/short. */
26
+ export declare function vowelLengthOf(phones: string): VowelLength;
27
+ /** Per-syllable vowel lengths for a word, to guide open/closed syllabification. */
28
+ export declare function syllableVowelLengths(syllables: {
29
+ phones: string;
30
+ stress?: number;
31
+ lexicalStress?: number;
32
+ }[]): VowelLength[];
33
+ export declare function syllabifyWord(word: string, syllableCount: number, vowelLengths?: VowelLength[], morphSuffix?: string): string[];
34
+ /**
35
+ * Flatten all syllables into display entries with word context.
36
+ * Each entry carries the original word text, the syllable text
37
+ * (orthographic chunk), the syllable's position within the word,
38
+ * and its relative stress level.
39
+ */
40
+ export declare function flattenDisplayEntries(words: ClsWord[]): SyllableDisplayEntry[];
41
+ //# sourceMappingURL=phonological.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phonological.d.ts","sourceRoot":"","sources":["../src/phonological.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,EACX,OAAO,EAGP,kBAAkB,EAClB,gBAAgB,EAChB,SAAS,EAET,oBAAoB,EACrB,MAAM,YAAY,CAAC;AAIpB;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,WAAW,GACpB,gBAAgB,EAAE,CAoBpB;AA0UD,wBAAgB,eAAe,CAAC,EAAE,EAAE,gBAAgB,GAAG,OAAO,EAAE,CAM/D;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,EAAE,CAMjE;AA+ED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,gBAAgB,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,CAGjF;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,gBAAgB,EAAE,EACvB,KAAK,EAAE,OAAO,EAAE,EAChB,WAAW,EAAE,SAAS,EAAE,GACvB,MAAM,CASR;AAsBD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEvD,2FAA2F;AAC3F,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAQzD;AAED,mFAAmF;AACnF,wBAAgB,oBAAoB,CAClC,SAAS,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,GACvE,WAAW,EAAE,CASf;AAsDD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,WAAW,EAAE,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CA0N/H;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,oBAAoB,EAAE,CAwB9E"}