> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langcraft.world/llms.txt
> Use this file to discover all available pages before exploring further.

# Lexical stress

> Preview syllable-level stress analysis in pronunciation responses

Lexical stress analysis shows how strongly each syllable was stressed and,
when available, which syllable is expected to carry primary stress.

The preview is returned automatically for supported requests; no additional
request field is required.

## Response location

Stress information appears inside:

```text theme={null}
word_groups[].syllables[].stress
```

For example:

```json theme={null}
{
  "text": "banana",
  "syllables": [
    {
      "index": 0,
      "text": "ba",
      "stress": {
        "score": 0.08,
        "expected": false
      }
    },
    {
      "index": 1,
      "text": "na",
      "stress": {
        "score": 0.87,
        "expected": true
      }
    },
    {
      "index": 2,
      "text": "na",
      "stress": {
        "score": 0.12,
        "expected": false
      }
    }
  ]
}
```

## Fields

| Field      | Type    | Meaning                                                                                                                  |
| ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------ |
| `score`    | number  | Detected stress strength for this syllable, from `0` to `1`. Higher values indicate stronger evidence of lexical stress. |
| `expected` | boolean | Whether this is the expected primary-stress syllable. Included only when an expected stress pattern is available.        |

A score near `0` indicates little detected evidence of lexical stress, while a
score near `1` indicates strong evidence. Values between them represent
increasing detected stress strength.

Each scoreable syllable receives its own score and is evaluated independently,
so scores do not need to sum to `1`.

## Availability

The preview currently supports English (`en`). Additional languages are under
evaluation.

The `stress` object is optional and may be omitted when unavailable. When the
expected pattern is unavailable, `score` can still be returned without
`expected`.

## Recommended integration

For every syllable with stress metadata, show the score and highlight
`expected: true` when present:

```ts theme={null}
for (const word of response.word_groups ?? []) {
  for (const syllable of word.syllables ?? []) {
    const stress = syllable.stress;

    if (!stress) continue;

    renderSyllableStress({
      text: syllable.text,
      scorePercent: Math.round(stress.score * 100),
      expected: stress.expected === true,
    });
  }
}
```

## Monosyllabic words

A one-syllable word can still receive a stress score representing its detected
stress strength. Stress-placement feedback applies only to multisyllabic words.

## Lexical stress vs prosody contours

Lexical stress and the optional prosody contour answer different questions:

| Feature         | Response field                         | Interpretation                              |
| --------------- | -------------------------------------- | ------------------------------------------- |
| Lexical stress  | `syllables[].stress.score`             | Syllable-level evidence of word stress      |
| Prosody contour | `word_groups[].prosody.stress_contour` | Frame-level relative emphasis across a word |

The prosody contour requires `enable_prosody_contours=true`. Lexical stress is
returned automatically when supported.
