speaker_helper.eardrum.intonation module

Intonation: the final melody a sentence’s own form calls for.

Module summary

The prosody loop compares what the voice did with what the text asks for. For the end of a sentence, what the text asks for follows from its form, and the form is readable from the words — no model needed:

French (Delais-Roussarie et al. 2015, Intonational phonology of French, in Frota & Prieto, Intonation in Romance, OUP; Di Cristo 1998):

  • a statement (.) falls; an exclamation (!) falls, with a wider range;

  • a yes/no question with no question marker (“Tu viens ?”) rises — the rise is the only thing that makes it a question;

  • tag and echo questions (”…, non ?”, “…, n’est-ce pas ?”, “Quoi ?”) rise;

  • “est-ce que …?” and subject-verb inversion (“Viens-tu ?”) may rise or fall;

  • a question opened by a wh-word (“Où vas-tu ?”, “Pourquoi … ?”) falls or may rise; a wh-word left at the end (“Tu vas où ?”) may do either;

  • an alternative question (”… A ou B ?”) falls on its last term.

English: yes/no questions with an inverted auxiliary prefer a rise, a declarative question rises, wh-questions and alternatives fall, statements and exclamations fall, tags may do either.

The answer is "rise", "fall" or "either". "either" is a real answer, not a shrug: the loop then accepts any contour, because forcing one would correct a reading that is not wrong.

Usage example

>>> expected_contour("Tu viens ce soir ?", "fr").shape
'rise'
>>> expected_contour("Où vas-tu ce soir ?", "fr").shape
'fall'

Author

Warith HARCHAOUI — https://linkedin.com/in/warith-harchaoui

class speaker_helper.eardrum.intonation.ExpectedContour(shape, reason)[source]

Bases: object

The final melody a sentence calls for, and why.

Parameters:
shape

"rise", "fall" or "either".

Type:

str

reason

The form that decided it ("yes/no question without marker"…).

Type:

str

reason: str
shape: str
speaker_helper.eardrum.intonation.contour_agrees(expected, heard)[source]

Whether a heard contour satisfies the expected one.

Parameters:
  • expected (ExpectedContour) – What the text calls for.

  • heard (str or None) – "rise", "fall", "level", or None when nothing could be measured.

Returns:

None when the contour could not be measured; True when the text accepts either, or the shapes match; False otherwise. A level ending satisfies only either.

Return type:

bool or None

Examples

>>> contour_agrees(ExpectedContour("rise", ""), "fall")
False
>>> contour_agrees(ExpectedContour("either", ""), "level")
True
speaker_helper.eardrum.intonation.expected_contour(sentence, language)[source]

The final contour sentence’s form calls for.

Parameters:
  • sentence (str) – One sentence (its final punctuation matters).

  • language (str) – ISO-639-1 code; French and English have rules, anything else gets the punctuation-only reading (? either, otherwise fall).

Returns:

The shape and the reason.

Return type:

ExpectedContour

Examples

>>> expected_contour("Tu vas où ?", "fr").shape
'either'
>>> expected_contour("Are you coming tonight?", "en").shape
'rise'
>>> expected_contour("Where are you going?", "en").shape
'fall'