get_tone_pattern
Analyze Cantonese text to produce tonal patterns (1056 or 0243) for matching lyrics with melody notes in songwriting.
Instructions
Analyze the tonal pattern of Cantonese text for lyrics writing.
Converts each character's tone to the 1056 or 0243 system used in Cantonese lyric writing to match syllables with melody notes.
The 1056 system groups Cantonese tones as:
1: High tones (tones 1, 2, 7) - highest pitch
0: Low falling (tone 4) - falling pitch
5: Mid tones (tones 3, 5, 8) - middle pitch
6: Low tones (tones 6, 9) - lowest pitch
The 0243 system uses different digits but same groupings:
3: High tones (tones 1, 2, 7)
0: Low falling (tone 4)
4: Mid tones (tones 3, 5, 8)
2: Low tones (tones 6, 9)
Args: text: Cantonese text to analyze system: Tonal classification system, either "1056" or "0243"
Returns: Dictionary with: - text: Original input text - system: The system used (1056 or 0243) - pattern: Condensed tone pattern string (e.g., "1560") - breakdown: Detailed per-character analysis
Example: Input: "今天天氣", system="1056" Output includes pattern like "1516" showing the tonal contour
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| system | No | 0243 |