Differences between revisions 1 and 2
 ⇤ ← Revision 1 as of 2007-04-24 19:49:23 → Size: 1219 Editor: DanBron Comment: script for comparing "variations" algorithms ← Revision 2 as of 2008-12-08 10:45:48 → ⇥ Size: 1209 Editor: anonymous Comment: converted to 1.6 markup Deletions are marked like this. Additions are marked like this. Line 2: Line 2: This script compares the "variations" algorithms given on the [wiki:Self:Phrases/Sets Sets page]. This script compares the "variations" algorithms given on the [[Phrases/Sets|Sets page]]. Line 33: Line 33: * [wiki:JForum:programming/2007-January/004948 The matrix to coordinates thread] on the Forum, which gives a framework for comparing algorithms.  * Another [:DanBron/Snippets/VerbMetrics:framework for verb metrics]. * [[JForum:programming/2007-January/004948|The matrix to coordinates thread]] on the Forum, which gives a framework for comparing algorithms.  * Another [[DanBron/Snippets/VerbMetrics|framework for verb metrics]].

## purpose

This script compares the "variations" algorithms given on the Sets page.

### script

```   hui0      =. dyad define
k=. i.>:d=.y-x
z=. (d\$<i.0 0),<i.1 0
for. i.x do. z=. k ,.&.> ,&.>/\. >:&.> z end.
; z
)

seed      =.  [: i.@(,&0)&.> <:@- {. 1:
cf        =.  i.@# ,.&.> ,&.>/\.@:(>:&.>)
hui1      =.  [: ; [ cf@[&0 seed

H0B       =:  ] {~ ,/@:((i.@:!@:[ A."0 1/ hui0 f.) #)
H1B       =:  ] {~ ,/@:((i.@:!@:[ A."0 1/ hui1 f.) #)

BJ0       =:  4 :'>@:,@:({."1) (0&{:: (<@:,"_ _1 ,"0 (<@:<@:<"0@:i.@:#<@{])@:]) 1&{::)"1^:x (\$0);<y'
BJ1       =:  vari =: [{."_1]A.~#@:]([(]*i.@:%)&!-)[

r         =: 1000 ts&>  ' ''abcdefg''' , L:0~  '4 ' , L: 0 fn =.  BJ0`BJ1`H0B`H1B

ts        =:  6!:2 , 7!:2@:]
fmt       =:  [: ,.&:>/ [: }.@:, (< ' ' \$~ 1 ,~ 2 + # fn) ,. (;:'Name Time Space') ,&.> '-' ,&.> [: <@:>"1@:|: [ ,. '0.3d' 8!:0 ] %"1 <./@:]

fn fmt r```