Skip to content

Commit

Permalink
Added README and fixed typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Julia Proft committed Aug 16, 2013
1 parent f2af4c7 commit ea6c371
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 18 deletions.
66 changes: 66 additions & 0 deletions README.md
@@ -0,0 +1,66 @@
Getting Started with the Scandroid
==================================

The Scandroid is a program that scans metrical English verse.
If you don't know what that means, you probably don't want to use it.

Under the GNU General Public License, the Scandroid is freely distributable.
You can give it away, use it in class, make it do all your poetry homework,
anything you like. You can also fork a copy of the Scandroid source code
and modify it as you please. Just be sure to give credit where it is due.

Below are brief descriptions of the various Scandroid modules.

Scandroid.py
------------

Main module. Handles the wxPython frame and most of the interface,
including the menus and button-presses that control everything.
Owns a ScansionMachine that does all the interesting work.

scanfuncs.py
------------

Contains the ScansionMachine class that has the methods called by Scandroid
to do the actual scansion work. It owns a dictionary and instances of a
Syllabizer and a Positioner for some of the grunt work.

syllables.py
------------

Divides a word into syllables, relying on regular expressions.

scanpositions.py
----------------

Positions all of the scansion marks (foot boundaries, stressed syllables,
unstressed syllables, etc.) above any line of poetry selected for scansion.

dictfuncs.py
------------

Holds the class that, rather loosely, contains methods and structures
connected with the dictionary of syllable-and-stress exceptions.

scandictionary.py
-----------------

Has the dictionary intended for use by the Scandroid. The words listed
are exceptions that will not be syllabized correctly by the routine method.

scanutilities.py
----------------

Contains utility classes and out-of-class functions.

scanstrings.py
--------------

Has text, strings, and generally useful globals the Scandroid needs;
Also, contains the Explainer class, which gabs about what we're doing
at every stage. Some non-class utility functions are also included.

scanstc.py
----------

Holds our subclasses of wx.StyledTextCtrl, or wx.STC, and bindings.
6 changes: 3 additions & 3 deletions Scandroid.py
Expand Up @@ -11,8 +11,8 @@
#
# Main module of the Scandroid, the Python version of the verse scanner.
# This module handles the wxPython frame and most of the interface,
# including the menus and button-presses that control everything. The Frame
# owns a ScansionMachine that does all the interesting work.
# including the menus and button-presses that control everything.
# The Frame owns a ScansionMachine that does all the interesting work.

# Version 1.5 (somewhat arbitrarily numbered) is the first revision in about
# seven years. The occasion was Jim O'Connor's coming on board to fix
Expand Down Expand Up @@ -117,7 +117,7 @@ def SetupGUI(self):

# -- CREATION OF STATUS BAR --
sb = wx.StatusBar(self, -1)
sb.SetFieldsCount(3) # inital dummy field prevents
sb.SetFieldsCount(3) # initial dummy field prevents
sb.SetStatusWidths([0, -1, -3]) # metron from being overwritten

# -- SETTING OF STATUS BAR --
Expand Down
16 changes: 8 additions & 8 deletions scanfuncs.py
Expand Up @@ -10,8 +10,8 @@
# OSI Certified Open Source Software
#
# This Scansion Machine class has the methods called by Scandroid to do the
# actual scansion work. It owns a dictionary and instances of a Syllabizer and
# a Positioner for some of the grunt work.
# actual scansion work. It owns a dictionary and instances of a Syllabizer
# and a Positioner for some of the grunt work.


import sre
Expand Down Expand Up @@ -313,7 +313,7 @@ def _measureComplexity(self, footlist, boundstest):
points += 4
# (does my code even allow for this to happen??)
if f in ('dactyl', 'cretic', 'bacchius'): points += 10
# esepcially disruptive positional variations
# especially disruptive positional variations
if f == 'trochee':
if inx == len(feet) - 1: points += 6 # scazon
if prevIsTrochee: points += 8 # "sprung rhythm"
Expand Down Expand Up @@ -584,9 +584,9 @@ def PromotePyrrhics(self, logger):
return self.P.GetScanString(), True

def HowWeDoing(self, logger):
"""Report results of iambic scansion: feet, and number of sustitutions.
"""Report results of iambic scansion: feet and number of substitutions.
The anlysis is crude even compared with _measureComplexity. Kiparsky
The analysis is crude even compared with _measureComplexity. Kiparsky
may suggest better possibilities, but they may not be usable without
more intelligence about syntax than the Scandroid has/likely will have.
"""
Expand Down Expand Up @@ -648,8 +648,8 @@ def scanAnapestics(self, scansion):
silently to report success or failure.
Fairly parallel to iambic DoAlgorithm. Called by DeduceParameters
directly for quick judgment. Also called, with alternate
stress-resoution preliminary scansions, by GetBestAnapLexes.
directly for quick judgement. Also called, with alternate
stress-resolution preliminary scansions, by GetBestAnapLexes.
"""
numsyls = len(scansion)
if self.LD.data['lfeetset']:
Expand Down Expand Up @@ -842,7 +842,7 @@ def AnapCleanUpAndReport(self, logger):
"""Final-condition check and Explainer call
to show results of anap scansion.
If any internal amphibrach, return fail and make suggetion. Replace
If any internal amphibrach, return fail and make suggestion. Replace
|x/|/x/| with |x//|x/| on general principle of greater regularity.
(I say the bacchius is less disruptive than the cretic. This is not
always right! but when not, it's because of syntax, which we know
Expand Down
4 changes: 2 additions & 2 deletions scanpositions.py
Expand Up @@ -79,7 +79,7 @@ def AddWord(self, syls, linePos):
if len(self.possLexicals) == 0:
self.possLexicals.append(self.GetMarks())
halfway = len(self.possLexicals)
self.possLexicals *= 2 # each amgibuity doubles the list
self.possLexicals *= 2 # each ambiguity doubles the list
for pL in range(0, halfway):
if len(syls) == 1: self.possLexicals[pL] += STRESS
else: self.possLexicals[pL] += (STRESS + SLACK)
Expand Down Expand Up @@ -124,7 +124,7 @@ def AddScanMark(self, mark, syllable):
"""Insert given mark into charlist of (spaced) scansion marks.
Place mark ('/', 'x', or '%') over the middle of the syllable. Note
that 'syllable' means something diffeernt in AddFootDivMark().
that 'syllable' means something different in AddFootDivMark().
"""
if syllable > len(self.sylmids): return # major woops
self.charlist[self.sylmids[syllable]] = mark
Expand Down
10 changes: 5 additions & 5 deletions scanstrings.py
Expand Up @@ -10,8 +10,8 @@
# OSI Certified Open Source Software
#
# Text, strings, and generally useful globals the Scandroid needs;
# Also, the Explainer class, which gabs about what we're doing at every
# stage. Also, some non-class utility functions.
# Also, the Explainer class, which gabs about what we're doing at
# every stage. Also, some non-class utility functions.

abouttxt = \
"""
Expand Down Expand Up @@ -41,9 +41,9 @@
Scanning, or at least run through the stations.
"""

STRESS = '/' # these are bogus, in that these signs are hard-
SLACK = 'x' # wired into, e.g., search strings; but maybe
PROMOTED = '%' # having them here will be a reminder
STRESS = '/' # these are bogus, in that these signs are hard-
SLACK = 'x' # wired into, e.g., search strings; but maybe
PROMOTED = '%' # having them here will be a reminder
SYLMARK = '#'
FOOTDIV = '|'

Expand Down

0 comments on commit ea6c371

Please sign in to comment.