antlong/picka — pull request #2 by TadLeonard (2014-01-16 08:56:23+00:00)
Title: Fixed test file, added alternative sentence maker

1) Fixed usage of `number` in tests (it takes one arg, not two)
2) Added `sentence_actual`, which returns an actual sentence from the Sherlock text.
3) Added `_picka._Book` class to hold the text and split sentences read from Sherlock.
Users can call sentence() without reading the entire file again and again.
4) Added test of `sentence_actual` to `picka.tests`

The `sentence_actual` function has some nice features:

1) You're much less likely to get a sentence fragment
2) You can specify a minimum and maximum number of words
3) It should be relatively efficient, because the split sentences are
cached by the `_Book` class.

The sentences aren't always perfect, but I think that has to do with the source. A book other than Sherlock Holmes, preferably one with less dialog, would give more "normal" sentences.