Hi,

I'm playing with J, just trying to get into the J mindset. A small program I 
wrote recently in another language was a small Markov chain sentence generator. 
This program had essentially two parts: parsing some input into some kind of 
internal representation, and generating sentences randomly using that. I'm 
trying to figure out how one would go about doing this in J.

My first thought is to make a bunch of nested boxed arrays, so given a sample 
input string it would produce a pair of arrays, one with the unique set of 
words, and another with boxed arrays of successor words. But stumbling onto the 
lab that discusses a dice game it seems like it might be more natural to write 
this in terms of some kind of transition table.

I am not looking for a concrete solution so much as clues as to how a J 
programmer would decompose this problem, and what techniques would be involved 
in solving it.

Thanks,

— 
Daniel Lyons

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to