--
From: Marshall Lochbaum
To: 'Pascal Jasmin' via Programming
Cc:
Sent: Wednesday, June 18, 2014 7:14:24 PM
Subject: Re: [Jprogramming] tree parsing
You can use recursion ($:) to generate the required tree.
a -: {.L:1 $:^:(0@:tree2 ". leaf <^:(2 %~ 0 i.~' '=]) &qu
ubject: Re: [Jprogramming] tree parsing
You can use recursion ($:) to generate the required tree.
a -: {.L:1 $:^:(0@:tree2 ". leaf <^:(2 %~ 0 i.~' '=]) "1 treetest
Note that {.L:1 is required as otherwise the leaves would be lists of
length 1. I'm not sure how to
You can use recursion ($:) to generate the required tree.
a -: {.L:1 $:^:(0@:tree2 ". leaf <^:(2 %~ 0 i.~' '=]) "1 treetest
Note that {.L:1 is required as otherwise the leaves would be lists of
length 1. I'm not sure how to prevent that from happening within the
verb that uses $: .
Here's anoth
all one line,
treetest =: >(((<' ') ('' ,~ ] #~ [ * <:@:#@:])"0 1~ each [: #S:1 {::) , each
<@": S:0) a=: (fac =: 3 : 'q =. q: y if. 1<#q do. (y ; [: fac "0 each y (] ,
%) ([: */ ] {~ # ?~ <.@:-:@:#)) q else. < y end.') 176715
treetest
1767150
189
9
3
3