Nth order chains #4

Merged
merged 5 commits into from Jun 29, 2015

Conversation

2 participants
@BenBergman
Contributor

BenBergman commented Jun 25, 2015

I modified the library to allow specifying arbitrary order Markov chains (previously it was restricted to 1st order). 2nd and 3rd order are handy for making text generation more natural looking.

My current arrangement doesn't really work for generate_from_token() at anything other than first order chains, but I'm not really sure what the best solution is for that. My first thought is to insert keys into the map for every order level and then if we generate from a single token, we grow the key length until we reach the chain order. This would probably slow down feeding the chain quite a bit though.

I also managed to break saving and loading of the chain. I'm pretty new to rust and serialization, so I'm not really sure where to start with fixing that.

aatxe added a commit that referenced this pull request Jun 29, 2015

@aatxe aatxe merged commit 931ea66 into aatxe:master Jun 29, 2015

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
@aatxe

This comment has been minimized.

Show comment
Hide comment
@aatxe

aatxe Jun 29, 2015

Owner

Looks good, thanks. I'll look into why serialization is broken.

Owner

aatxe commented Jun 29, 2015

Looks good, thanks. I'll look into why serialization is broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment