Re: [Jprogramming] x u/. y Key

2019-10-12 Thread 'Jim Russell' via Programming
Only 64? So worst case ascii text summaries would be 64^ 3 rows? > On Oct 12, 2019, at 6:36 PM, 'Mike Day' via Programming > wrote: > > Yes, that’s me. > > Sorry about the “Nb”s ... I was adding comments and trying to make the lines > runnable. > > I should have said that I wrote these e

Re: [Jprogramming] x u/. y Key

2019-10-12 Thread 'Mike Day' via Programming
Yes, that’s me. Sorry about the “Nb”s ... I was adding comments and trying to make the lines runnable. I should have said that I wrote these example functions just for this discussion. They’re not well tested, nor, likely/possibly, proof against edge conditions such as empty datasets. BTW,

[Jprogramming] x u/. y Key

2019-10-12 Thread 'Jim Russell' via Programming
One more (I promise, I’ll stop hogging the fourm) mail to script conversion, this time from Ric’s contribution. (This is all great stuff, thank you guys very much!!) NB. Rick2, without Key NB.If you want compare the summaries without the original text strings, then NB.perhaps Key is not the b

Re: [Jprogramming] x u/. y Key

2019-10-12 Thread 'Jim Russell' via Programming
> On Oct 12, 2019, at 1:52 PM, 'Mike Day' via Programming > wrote: > > Sorry, I wasn’t considering trigrams in my off the cuff stuff, > > Mike > Thanks Mike (Day?). Can’t always tell with fourm replies until I reply… I appreciate (and am still studying) your stuff, and learning a lot from

Re: [Jprogramming] x u/. y Key

2019-10-12 Thread 'Mike Day' via Programming
Sorry, I wasn’t considering trigrams in my off the cuff stuff, Mike Sent from my iPad > On 12 Oct 2019, at 18:38, 'Jim Russell' via Programming > wrote: > > Thanks. (Except for the part about etaionshrdlu... and the fact that I was > unaware of any difference between prepend and prefix.) I

Re: [Jprogramming] x u/. y Key

2019-10-12 Thread 'Jim Russell' via Programming
Thanks. (Except for the part about etaionshrdlu... and the fact that I was unaware of any difference between prepend and prefix.) I had considered texts using different character sets, and figured I would be comfortable reporting them as completely different. Thanks for the insights! (I shou

Re: [Jprogramming] x u/. y Key

2019-10-12 Thread 'Mike Day' via Programming
eg for Ric Sherlock’s example, modified for unequal sample sizes: Apologies for non-alignment, as seen on iPad anyway. ]'X Y'=: 'actg' {~ 2 30 ?@$ 4 catctaagtcgataatccacttacttccgg cagcaaggacaggtgctaatacacactcgc [X =: 'actg' {~ 40?@$ 4 ttagcacttccctcagagttacccacactagctggtgcag fr1 each X

Re: [Jprogramming] x u/. y Key

2019-10-12 Thread 'Jim Russell' via Programming
You'r right. I started to define it assigned as a string, but screwed that up too. Took me just as long to learn del definition too :-). > On Oct 12, 2019, at 12:53 PM, Brian Schott wrote: > > Your verb show needs a y in it. > > > show=: verb define > <: #/.~&> y > ) > show supertrig >

Re: [Jprogramming] x u/. y Key

2019-10-12 Thread 'Mike Day' via Programming
The advantage is that you’re in control of the domain of interest. You know all cases that _might_ arise. With my example of a given alphabet, we might be looking at the frequency of letters in English prose, and find their sort order is along the lines of etaionshrdlu... (iirc). Not so goo

Re: [Jprogramming] x u/. y Key

2019-10-12 Thread Brian Schott
Oops, my mistake. I intended the first version of show to be yours (without y), not mine (with y). On Sat, Oct 12, 2019 at 12:53 PM Brian Schott wrote: > Your verb show needs a y in it. > > >show=: verb define > <: #/.~&> y NB. here is the mistake. > ) >show supertrig > |noun

Re: [Jprogramming] x u/. y Key

2019-10-12 Thread Brian Schott
Your verb show needs a y in it. show=: verb define <: #/.~&> y ) show supertrig |noun result was required: show | <:#/.~&> $trig 2 show=: verb define <: #/.~&> y ) show supertrig 1 1 1 1 1 1 1 1 1 2 2 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0

Re: [Jprogramming] x u/. y Key

2019-10-12 Thread 'Jim Russell' via Programming
Genius! I tried (and failed) to convert your reply to a script on my iPhone: X=:'Now is the time for all good men to come ti' Y=: 'Now is the time for the quick brown good men to come ti' trig=: 3,\&.> X;Y NB. Get the nub of the union of both sets of trigrams and prepend it to each trigram set.

Re: [Jprogramming] x u/. y Key

2019-10-12 Thread 'Jim Russell' via Programming
Thanks, interesting. What advantage that give you? > On Oct 12, 2019, at 9:02 AM, 'Mike Day' via Programming > wrote: > > A quick thought, might not be what you have in mind. > > If, say, you’re seeking the frequency of letters, it’s worth prefixing the > sorted alphabet of interest to yo

Re: [Jprogramming] x u/. y Key

2019-10-12 Thread 'Mike Day' via Programming
A quick thought, might not be what you have in mind. If, say, you’re seeking the frequency of letters, it’s worth prefixing the sorted alphabet of interest to your string and then subtracting one from the scores. Useful for me sometimes, anyway. Mike Sent from my iPad > On 12 Oct 2019, at

Re: [Jprogramming] x u/. y Key

2019-10-12 Thread Ric Sherlock
If you want compare the summaries without the original text strings, then perhaps Key is not the best approach. This should work: getTrigrams=: 3 ,\ ] countTrigrams=: (~. ; #/.~)@getTrigrams compareTrigrams=: dyad define alltrig=. x ~.@;@,&({.) y cnttrigs=. ((alltrig i.~ [) { 0 ,~ ])&>/&> x; w