Skip to content

Commit

Permalink
Merge pull request #187 from TylerKirby/master
Browse files Browse the repository at this point in the history
Updated docs to include clausulae_analysis and reflect recent changes to the Latin scanner
  • Loading branch information
kylepjohnson committed Mar 9, 2016
2 parents aae3529 + 629c264 commit bf71a6e
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions docs/latin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,32 @@ For most of the following operations, you must first `import the CLTK Latin ling

Note that for most of the following operations, the j/i and v/u replacer ``JVReplacer()`` and ``.lower()`` should be used on the input string first, if necessary.

Clausulae Analysis
==================
Clausulae analysis is an integral part of Latin prosimetrics. The clausulae analysis module analyzes prose rhythm data generated by the prosody module to produce a dictionary of common rhythm types and their frequencies.

The list of rhythms which the module tallies is drawn from John Ramsey's list of common Ciceronian clausulae. See Ramsey, John. *Cicero: The Philippics I-II*. Cambridge: Cambridge University, 2003: 22 for more.

.. code-block:: python
In [1]: from cltk.prosody.latin.scanner import Scansion
In [2]: from cltk.prosody.latin.clausulae_analysis import Clausulae
In [3]: text = 'quō usque tandem abūtēre, Catilīna, patientiā nostrā. quam diū etiam furor iste tuus nōs ēlūdet.'
In [4]: s = Scansion()
In [5]: c = Clausulae()
In [6]: prosody = s.scan_text(text)
Out[6]: ['¯˘¯˘¯¯˘˘˘¯˘˘˘¯˘¯¯x', '¯˘¯˘¯˘˘¯˘˘¯¯¯¯x']
In [7]: c.clausulae_analysis(prosody)
Out[7]: {'1st paeon + trochee': 0, 'molossus + iamb': 0, '1st paeon + anapest': 0, '4th paeon + trochee': 0, 'choriamb + double trochee': 0, 'molossus + cretic': 0, 'double spondee': 1, 'molossus + double trochee': 0, 'substituted cretic + trochee': 0, 'cretic + iamb': 0, 'cretic + trochee': 1, 'double trochee': 0, 'heroic': 0, 'cretic + double trochee': 0, 'cretic + double spondee': 0, '4th paeon + cretic': 0, 'double cretic': 0, 'dactyl + double trochee': 0}
Converting J to I, V to U
=========================
.. code-block:: python
Expand Down Expand Up @@ -277,7 +303,7 @@ TnT tagger
Prosody Scanning
================
A prosody scanner is available for text which already has had its natural lengths marked with macrons. It returns a list of strings of long and short marks for each sentence.
A prosody scanner is available for text which already has had its natural lengths marked with macrons. It returns a list of strings of long and short marks for each sentence, with an anceps marking the last syllable of each sentence.

.. code-block:: python
Expand All @@ -288,7 +314,7 @@ A prosody scanner is available for text which already has had its natural length
In [3]: text = 'quō usque tandem abūtēre, Catilīna, patientiā nostrā. quam diū etiam furor iste tuus nōs ēlūdet.'
In [4]: scanner.scan_text(text)
Out[4]: ['¯˘¯˘¯¯˘˘˘¯˘˘˘¯˘¯¯¯', '¯˘¯˘¯˘˘¯˘˘¯¯¯¯˘']
Out[4]: ['¯˘¯˘¯¯˘˘˘¯˘˘˘¯˘¯¯x', '¯˘¯˘¯˘˘¯˘˘¯¯¯¯x']
Sentence Tokenization
Expand Down

0 comments on commit bf71a6e

Please sign in to comment.