about summary refs log tree commit diff stats
path: root/malaprop.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' of https://github.com/hatkirby/rawr-ebooksKelly Rauchenberger2016-01-041-1/+0
|\ | | | | | | | | Conflicts: malaprop.cpp
| * Rewrote quite a bit of kgramstatsKelly Rauchenberger2016-01-041-0/+5
| | | | | | | | | | | | The algorithm still treats most tokens literally, but now groups together tokens that terminate a clause somehow (so, contain .?!,), without distinguishing between the different terminating characters. For each word that can terminate a sentence, the algorithm creates a histogram of the terminating characters and number of occurrences of those characters for that word (number of occurrences is to allow things like um???? and um,,,,, to still be folded down into um.). Then, when the terminating version of that token is invoked, a random terminating string is added to that token based on the histogram for that word (again, to allow things like the desu-ly use of multiple commas to end clauses). The algorithm now also has a slightly advanced kgram structure; a special "sentence wildcard" kgram value is set aside from normal strings of tokens that can match any terminating token. This kgram value is never printed (it is only ever present in the query kgrams and cannot actually be present in the histograms (it is of a different datatype)) and is used at the beginning of sentence generation to make sure that the first couple of words generated actually form the beginning of a sentence instead of picking up somewhere in the middle of a sentence. It is also used to reset sentence generation in the rare occasion that the end of the corpus is reached.
* | ????Kelly Rauchenberger2015-11-261-0/+6
|/
* std::set seems to have some problem with inserting an empty string. Warrants ↵Kelly Rauchenberger2015-11-231-2/+7
| | | | further investigation.
* Added malapropismsKelly Rauchenberger2015-11-221-0/+127