On Sun, May 4, 2014 at 3:58 AM, Linda Alvord <[email protected]> wrote: > I'd like to write an explicit verb that has his result.
Here is how I would implement that. Do not look if you want to figure it out for yourself, first. s p o i l e r s p a c e . . . d o n o t l o o k t o o s o o n . . . NB. fully explicit implementation of NB. /:~ (~.@[ (,'|',])&":"_1 ":@/:~/.)/|:0 10 #: ruth ruth=: 54 59 35 41 46 25 47 60 54 46 49 46 41 34 22 stemplot=:3 :0 split=. 0 10#:y 'stems leaves'=.|: split plotable=. stems formatleaves/. leaves uniquestems=. ~. stems unsorted=. uniquestems gluestem"_1 plotable /:~ unsorted ) formatleaves=:3 :0 orderedleaves=. /:~ y ": orderedleaves ) gluestem=: 3 :0 assert. 0 NB. give this verb a left argument : stemtext=. ": x stemtext,'|',y ) Usage: stemplot ruth Note that we have omitted some "structural" or maybe "grammatical" words which were present in the original - they have been replaced by J's parsing mechanics and by the arrangements of names in the explicit mini-sentences. Thanks, -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
