Changed representations of words to matrices.

This included a change of feature values from strings to integers.
Also changed Gen so that changes record only these three features of the
segments that were affected: vocalic, consonantal, and sonorant.
The matrix change required changes to Markedness.pick_unique_pattern(), which
needed work anyway. The current implementation is better in theory, but it uses
count(), which doesn't work on matrices, so that needs to be translated to
something that works.
Changed representations of words to matrices.

This mainly involved changes in FeatureDict and Markedness. The format of the
input file also changed.
Changed change_feature_value to only create real segments.

It can perform many feature changes at once, but it's more likely to perform
fewer. This will save time by not creating bad sr's that have to be remade.
Changed Markedness to deal with sr only when creating constraint.
Added MarkednessAligned, refactored Markedness

MarkednessAligned is a subclass of Markedness that assumes no epenthesis or
deletion, which makes making a constraint more straightforward.
Refactored throughout, especially Markedness.
Added save option for Input, added files, debugged.

The input is read from a file if the right one exists, or else made and then
written to a file.

Mapping and FeatureDict are now in their own files so that
cPickle will work.

Debugged and sped up change_feature_value, ungrammaticalize, MarkednessAligned.
Removed make_tableaux. It's now implemented in make_input, which sped it up.
Changed frequency of induction.

And division of labor between evaluate and train or test. Also working towards
using get_ngrams in Mapping, not Markedness.

Made major_features include dont-cares. Will change changelogs to lists so this
information can be used.
Added don't-cares to segments. Fixed faithfulness constraints.

Don't-cares: without segments having these, a constraint on backness would treat
front vowels and all consonants as a natural class. They are now added and
get_violation is fixed accordingly.

Faithfulness: these now have don't-cares among the three features they track, so
they aren't overly specific.

The program now works on TurkishInput2.csv, the file with real Turkish inputs
with only feature changes (and possibly some metathesis mixed in). The str
method for constraints is still buggy, though.
Removed anti-faithfulness constraints.

Now if the computed winner doesn't have a change that the grammatical winner
lacks, no faithfulness constraint will be made. Positive faithfulness
constraints won't be used --- instead, a markedness constraint is needed (and is
being made).
Added positive markedness constraints.

They will be implemented not through the weights, which will start out positive,
but through the violations, which will be positive or negative depending on
which form the constraint was made from.
Changed words to arrays of sets.

Required changes in feature dictionary, Gen, Markedness, and Faithfulness.

Only fixed change feature value in Gen. Need to update others.

Resulted in faster Markedness.get_violation().
Backup.

Finding lots of bugs --- want to clean stuff up without worrying about needing
it back.
Fixed filtering out of duplicate constraints.

Changed duplicate test and added __eq__ methods to constraints.
Fixed bugs in constraints and changelogs.

Changelogs as sets would lose duplicate changes. Also, faithfulness constraints
didn't take into account the possibility of different numbers of the same
change. Those are fixed.

Major features are abandoned for the time being for
simplicity, under the assumption that markedness constraints can pick up the
slack.

Faithfulness constraints can now be indifferent to feature value.

Markedness constraints were changed to avoid duplicates, ngrams longer than the
word, or tiers that eliminate differences between winners.

Constraint weights are graphed.
Added random selection of test set.

Instead of giving two files, you give one file and it randomly takes a tenth of
it as the test set.
Deleted commented out old code.
Added graph of errors and constraints over time.
Changed feature sampling to Zipfian distribution.

Was sampling number of features to change in GEN from geometric distribution
(discrete version of exponential) and number of features to keep in Markedness
constraints from uniform distribution. Now sampling both from Zipfian
distribution, which seems more grounded because the power law is ubiquitous in
psychology and Zipf's law is from linguistics. Will make constraints more
general.
Changed constraint induction.

Only a markedness or faithfulness constraint is induced, not both.

Induction is followed up by another round of evaluation, so that weights can be
updated.