8.1.12.1.8. cltk.phonology.non package¶
Old Norse phonology
8.1.12.1.8.1. Subpackages¶
8.1.12.1.8.2. Submodules¶
8.1.12.1.8.3. cltk.phonology.non.orthophonology module¶
Old Norse orthophonology module similar to the cltk.phonology.non.transcription with a different way to transcribe
8.1.12.1.8.4. cltk.phonology.non.phonology module¶
- class cltk.phonology.non.phonology.OldNorseTranscription[source]¶
Bases:
object
Phonological transcriber for Old Norse
8.1.12.1.8.5. cltk.phonology.non.syllabifier module¶
Sonority hierarchy for Old Norse
8.1.12.1.8.6. cltk.phonology.non.transcription module¶
Old Norse transcription module. Sources: - https://fr.wikipedia.org/wiki/%C3%89criture_du_vieux_norrois - Altnordisches Elementarbuch by Friedrich Ranke and Dietrich Hofmann
- class cltk.phonology.non.transcription.OldNorsePhonology(height, backness, rounded, length, ipar)[source]¶
Bases:
Vowel
Class that applies position-dependent phonological transformation
- U_UMLAUT = {'a': 'ö', 'ö': 'u'}¶
- static phonetic_i_umlaut(sound)[source]¶
>>> umlaut_a = OldNorsePhonology.phonetic_i_umlaut(a) >>> umlaut_a.ipar 'ɛ'
>>> umlaut_au = OldNorsePhonology.phonetic_i_umlaut(DIPHTHONGS_IPA_class["au"]) >>> umlaut_au.ipar 'ɐy'
- static orthographic_i_umlaut(sound)[source]¶
>>> OldNorsePhonology.orthographic_i_umlaut("a") 'e' >>> OldNorsePhonology.orthographic_i_umlaut("ý") 'ý'
- Parameters:
sound (
str
) – vowel- Return type:
str
- Returns:
transformed vowel
- cltk.phonology.non.transcription.measure_old_norse_syllable(syllable)[source]¶
Old Norse syllables are considered as: - short if - long if - overlong if
>>> measure_old_norse_syllable([m, a.lengthen(), l]).name 'long'
>>> measure_old_norse_syllable([a, l]).name 'short'
>>> measure_old_norse_syllable([s, t, ee, r, k, r]).name 'long'
>>> measure_old_norse_syllable([m, o.lengthen()]).name 'long'
- Parameters:
syllable (
list
) – list of Vowel and Consonant instances- Return type:
Optional
[Length
]- Returns:
instance of Length (short, long or overlong)
8.1.12.1.8.7. cltk.phonology.non.utils module¶
To define sounds, phonetic rules for phonetic transcription.
- class cltk.phonology.non.utils.AutoName(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
Enum
- class cltk.phonology.non.utils.Manner(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
AutoName
- nasal = 'nasal'¶
- stop = 'stop'¶
- lateral = 'lateral'¶
- fricative = 'fricative'¶
- trill = 'trill'¶
- spirant = 'spirant'¶
- affricate = 'affricate'¶
- approximant = 'approximant'¶
- class cltk.phonology.non.utils.Place(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
AutoName
- bilabial = 'bilabial'¶
- labio_dental = 'labio_dental'¶
- dental = 'dental'¶
- alveolar = 'alveolar'¶
- post_alveolar = 'post_alveolar'¶
- retroflex = 'retroflex'¶
- palatal = 'palatal'¶
- velar = 'velar'¶
- uvular = 'uvular'¶
- glottal = 'glottal'¶
- class cltk.phonology.non.utils.AbstractConsonant(place=None, manner=None, voiced=None, ipar=None, geminate=None)[source]¶
Bases:
object
Used with AbstractPosition to define an environment of a sound
- class cltk.phonology.non.utils.Consonant(place, manner, voiced, ipar, geminate)[source]¶
Bases:
AbstractConsonant
A consonant is defined mostly by the its place (where in the vocal tract the obstruction of the consonant occurs, and which speech organs are involved), its manner how air escapes from the vocal tract when the consonant or approximant (vowel-like) sound is made), by if it is voiced or not, its length (if it is geminate). An IPA standard is at: <https://en.wikipedia.org/wiki/International_Phonetic_Alphabet>_.
- match(abstract_consonant)[source]¶
A real consonant matches an abstract consonant if and only if the required features of the abstract consonant are also features of the real consonant. :type abstract_consonant:
AbstractConsonant
:param abstract_consonant: AbstractConsonant :rtype:bool
:return: bool
- class cltk.phonology.non.utils.Height(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
AutoName
- open = 'open'¶
- near_open = 'near_open'¶
- open_mid = 'open_mid'¶
- mid = 'mid'¶
- close_mid = 'close_mid'¶
- near_close = 'near_close'¶
- close = 'close'¶
- class cltk.phonology.non.utils.Backness(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
AutoName
- front = 'front'¶
- central = 'central'¶
- back = 'back'¶
- class cltk.phonology.non.utils.Length(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
AutoName
- short = 'short'¶
- long = 'long'¶
- overlong = 'overlong'¶
- class cltk.phonology.non.utils.AbstractVowel(height=None, backness=None, rounded=None, length=None, ipar=None)[source]¶
Bases:
object
Used with AbstractPosition to define an environment of a sound
- class cltk.phonology.non.utils.Vowel(height, backness, rounded, length, ipar)[source]¶
Bases:
AbstractVowel
- class cltk.phonology.non.utils.Rank(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
AutoName
- first = 'first'¶
- inner = 'inner'¶
- last = 'last'¶
- class cltk.phonology.non.utils.AbstractPosition(position, before, after)[source]¶
Bases:
object
- This is a position (at the beginning, inside or at the end) that a rule can be applied at,
a sound or a set of sounds before and a sound or a set of sounds after
- class cltk.phonology.non.utils.Position(position, before, after)[source]¶
Bases:
object
This is a position (at the beginning, inside or at the end) of a an observed word, a sound before and a sound after
- real_sound_match_abstract_sound(abstract_pos)[source]¶
If an observed position :type abstract_pos:
AbstractPosition
:param abstract_pos: :rtype:bool
:return:
- class cltk.phonology.non.utils.Rule(position, temp_sound, estimated_sound)[source]¶
Bases:
object
A Rule is used to transform one sound to another according to its direct environment (the letter before and the letter after). If a rule is applicable, then it is applied.
- can_apply(current_position)[source]¶
A Rule is applied if and only if a letter has a direct environment (the sound just before and the sound just after) which matches the environment of Rule :type current_position:
Position
:param current_position: :rtype:bool
:return: bool
- ipa_to_regular_expression(phonology)[source]¶
- Parameters:
phonology – list of Vowel or Consonant instances
- Returns:
pattern which can be the first argument of re.sub
- static from_regular_expression(re_rule, estimated_sound, ipa_class)[source]¶
- Parameters:
re_rule – pattern (first argument of re.sub)
estimated_sound – an IPA character (second argument of re.sub)
ipa_class – dict whose keys are IPA characters and values are Vowel or Consonant instances
- Returns:
corresponding Rule instance
- class cltk.phonology.non.utils.Transcriber(diphthongs_ipa, diphthongs_ipa_class, ipa_class, rules)[source]¶
Bases:
object
- There are two steps to transcribe words:
firstly, a greedy approximation of the pronunciation of word
then, use of rules to precise pronunciation of a preprocessed list of transcribed words
- word_to_phonetic_representation(word, with_squared_brackets=True)[source]¶
- Parameters:
word – normalized word
with_squared_brackets –
- Returns:
- text_to_phonetic_representation(sentence, with_squared_brackets=True)[source]¶
- Parameters:
sentence (
str
) –with_squared_brackets –
- Return type:
str
- Returns:
- class cltk.phonology.non.utils.PhonologicalRule(condition, action)[source]¶
Bases:
BasePhonologicalRule
- class cltk.phonology.non.utils.WordInitialPhonologicalRule(condition, action)[source]¶
Bases:
BasePhonologicalRule
- class cltk.phonology.non.utils.WordFinalPhonologicalRule(condition, action)[source]¶
Bases:
BasePhonologicalRule