Browse files

updated docs

  • Loading branch information...
clemsciences committed Sep 10, 2018
1 parent 626c0fd commit 17e245f0dd362d46f567f0f162a24a51ff50807e
Showing with 14 additions and 8 deletions.
  1. +14 −8 docs/old_norse.rst
@@ -151,25 +151,31 @@ For a language-dependent approach, you can call the predefined sonority dictiona
.. code-block:: python
In[1]: s = Syllabifier(language='old_norse')
In[1]: from cltk.phonology.syllabify import Syllabifier
In[2]: s.syllabify("danmarkar")
In[2]: s = Syllabifier(language='old_norse')
Out[2]: ['dan', 'mar', 'kar']
In[3]: s.syllabify("danmarkar")
Out[3]: ['dan', 'mar', 'kar']
Length of syllables in Old Norse poems plays a great role. To measure this, words have first to be phonetically transcribed. This is why "old_norse_ipa" language is used
.. code-block:: python
In[1]: s = Syllabifier(language="old_norse_ipa")
In[1]: import cltk.phonology.old_norse.transcription as ont
In[2]: from cltk.phonology.syllabify import Syllabifier
In[3]: syllabifier = Syllabifier(language="old_norse_ipa")
In[2]: word = [ont.a, ont.s, ont.g, ont.a, ont.r, ont.dh, ont.r]
In[4]: word = [ont.a, ont.s, ont.g, ont.a, ont.r, ont.dh, ont.r]
In[3]: syllabified_word = syllabifier.syllabify_phonemes(word)
In[5]: syllabified_word = syllabifier.syllabify_phonemes(word)
In[4]: [ont.measure_old_norse_syllable(syllable) for syllable in syllabified_word]
In[6]: [ont.measure_old_norse_syllable(syllable) for syllable in syllabified_word]
Out[4]: [<Length.short: 'short'>, <Length.long: 'long'>]
Out[6]: [<Length.short: 'short'>, <Length.long: 'long'>]
Old Norse prosody

0 comments on commit 17e245f

Please sign in to comment.