File size: 2,194 Bytes
e0e1444
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Faithful port of Scandroid_py_source/scanstrings.py's global constants, plus
// syllables.py's module-level constant tuples.  This whole `scandroidNative/`
// tree is a SELF-CONTAINED re-implementation of Charles Hartman's 2005
// Scandroid: its own syllabifier, its own small stress dictionary, its own two
// iambic algorithms, its own anapestic algorithm.  Nothing here reads a
// Calliope-derived stress grade, dependency parse, or phonological hierarchy —
// scanLineNatively (engine.ts) takes only the raw line text, exactly as
// Hartman's ParseLine did.  It is a genuine second, independent opinion.

export const STRESS = '/';
export const SLACK = 'x';
export const PROMOTED = '%';
export const SYLMARK = '#';
export const FOOTDIV = '|';

/** Iambic foot dictionary (Scandroid's footDict), verbatim. */
export const footDict: Record<string, string> = {
  'x/': 'iamb',
  'xx': 'pyrrhic',
  '//': 'spondee',
  '/x': 'trochee',
  'x/x': 'amphibrach',
  '//x': 'palimbacchius',
  'xx/': 'anapest',
  '/': 'defective',
  '/xx': 'dactyl',
  '/x/': 'cretic',
  'x//': 'bacchius',
  'x%': '(iamb)',
  'xx%': '(anapest)',
  '%x': '(trochee)',
  'x/xx': '2nd paeon',
  'xx/x': '3rd paeon',
};

/** Anapestic foot dictionary (Scandroid's AnapSubs), verbatim. */
export const AnapSubs: Record<string, string> = {
  'xx/': 'anapest',
  '/x/': 'cretic',
  'x//': 'bacchius',
  'x/': 'iamb',
  'x%': '(iamb)',
  'xx%': '(anapest)',
  '//': 'spondee',
  'xx/x': '3rd paeon',
  'x/x': 'amphibrach',
  '///': 'molossus',
  '/x%': '(cretic)',
  '//x': 'palimbacchius',
};

export const lineLengthName = [
  '', '', 'DIMETER', 'TRIMETER', 'TETRAMETER', 'PENTAMETER',
  'HEXAMETER', 'HEPTAMETER', 'OCTAMETER', 'NONAMETER',
];

// ─── syllables.py module constants ─────────────────────────────────

export const SIBILANTS = '40xzjgsc';
export const MIDS = 'bdfgklmnpstw%0245';
export const MULTISUFFIX = ['ible', 'able'];
export const STRESSSUFFIX = [
  'tion', 'sion', 'tiou', 'ciou', 'tious',
  'cious', 'cion', 'gion', 'giou', 'gious',
];
export const PREFIXES = ['a', 'as', 'be', 'con', 'de', 'di', 'ex', 're', 'un', 'en'];