[tw5] Re: split agglomerates

2021-04-30 Thread Jean-Pierre Rivière
Thank you. The doc, at subfilter, does clearly states what filter does. 

The examples fail to make clear of this distinction for subfilter. In fact, 
they are rather not too much helping.

The first one is 

[subfilter[one two three]addsuffix[!]]

producing 

   - one!  
   - two!  
   - three!  


and we can achieve the very same results with

[enlist[one two three]addsuffix[!]]

This is not very demonstrative.

I suggest these ones:

\define two-wanted() [compare:string:eq[two]addsuffix[*]]

<<.operator-example 1 "[subfilter[one two three]addsuffix[!]]">>
<<.operator-example 1.1 "[enlist[one two three]addsuffix[!]]">>
<<.operator-example 1.2 "[enlist[one two three]subfilter]">>
<<.operator-example 1.3 "[enlist[one two 
three]compare:string:eq[two]addsuffix[*]]">>
<<.operator-example 1.4 "[enlist[one two three]filter]">>

showing that subfilter, finally, is just a nice way to put a name on a 
sequence of filter operations, for better clarity. 1.2 and 1.3 have the 
same output: "two*" whereas that of 1.4 is "two"k

In general, the operator of similar effect would gain from comparison like 
such.


Le vendredi 30 avril 2021 à 11:59:38 UTC+2, saq.i...@gmail.com a écrit :

> Sortsub applies a filter in turn to each input title separately. The docs 
> do mention this I believe. So the input to the filter each time is a single 
> title.
>
> Subfilter applies a filter once with the input being a title list of all 
> input titles.
>
> On Friday, April 30, 2021 at 10:53:52 AM UTC+2 jn.pierr...@gmail.com 
> wrote:
>
>> Nestling, in such a way anyway, is something I had not thought about.
>>
>> In fact, this is only a part of the pipeline. Can I get back a united 
>> output afterwards? I'll experiment and if I'm at loss, I'll post again.
>>
>> A question remains for me: Why is "split + last" apparently working on so 
>> different data when called by sortsub or subfilter? Aren't they just 
>> calling a filter? What is causing the diffirence? I think it would be wise 
>> and good for me to understand what cause the difference in behavior of such 
>> similar patterns.
>>
>> regards,
>>
>> -- 
>> Jean-Pierre
>> Le vendredi 30 avril 2021 à 07:15:37 UTC+2, TW Tones a écrit :
>>
>>> Jean-Pierre;
>>>
>>> I am not sure about your requirement, but try these
>>>
>>> <$list filter="[enlist[a1^a2 b1^b2 c1^c2]]">
>>>{{{ [split[^]first[]] }}}
>>> 
>>> 
>>> <$list filter="[enlist[a1^a2 b1^b2 c1^c2]]">
>>><$list filter="[split[^]first[]]">
>>>
>>>
>>> 
>>> 
>>> <$list filter="[enlist[a1^a2 b1^b2 c1^c3]split[^]]">
>>>
>>> 
>>> 
>>> <$list filter="[[a1^a2 b1^b2 c1^c3]split[ ]split[^]]">
>>>
>>> 
>>>
>>> I was recently considering a similar problem, when someone was 
>>> questioning nesting list widgets, when I realised the $list with filters 
>>> can act as gosub, while, do until etc... so nesting them is by definition 
>>> sometimes a logical requirement depending what you are trying to achieve 
>>> with your filters. Nesting is not easy or possible in many cases with 
>>> triple curly braces.
>>>
>>> Regards
>>> Tones
>>>
>>> On Friday, 30 April 2021 at 07:15:04 UTC+10 jn.pierr...@gmail.com wrote:
>>>
 Toying with filters, I discovered that the split operator agglomerates 
 its results when ist operates on successive titles.

 for instance : {{{ [enlist[a1^a2 b1^b2 c1^c2]split[^][]first[]] }}}
 results in a1 not in a1, b1, c1

 a sufilter dos not change anything:

 <$vars sf="[split[^]dump[]first[]]">
 {{{ [enlist[a1^a2 b1^b2 c1^c2]subfilter] }}}
 

 In fact, in each case, after split, the filter values are a1, a2, b1, 
 b2, c1, c2.

 could there be a way to have [a1, a2], [b1, b2], [c1, c2] 
 from enlist[a1^a2 b1^b2 c1^c2] ?

 let's use sortsub and a little input set to see that what I am asking 
 for may not be that impossible.

 <$vars sf="[split[^]dump[]last[]]">
 {{{ [enlist[a1^22 b1^28 c1^14]sortsub] }}}
 

 reults in c1^14, a1^22, b1^28

 which demonstrate that here split produces things like c1, 14 on which 
 split act upon. exactly what I wanted to achieve with subfilter.

 -- 
 Jean-Pierre



-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/395d8ee0-b056-4c48-b682-6d371bd9d34en%40googlegroups.com.


[tw5] Re: split agglomerates

2021-04-30 Thread Saq Imtiaz
Sortsub applies a filter in turn to each input title separately. The docs 
do mention this I believe. So the input to the filter each time is a single 
title.

Subfilter applies a filter once with the input being a title list of all 
input titles.

On Friday, April 30, 2021 at 10:53:52 AM UTC+2 jn.pierr...@gmail.com wrote:

> Nestling, in such a way anyway, is something I had not thought about.
>
> In fact, this is only a part of the pipeline. Can I get back a united 
> output afterwards? I'll experiment and if I'm at loss, I'll post again.
>
> A question remains for me: Why is "split + last" apparently working on so 
> different data when called by sortsub or subfilter? Aren't they just 
> calling a filter? What is causing the diffirence? I think it would be wise 
> and good for me to understand what cause the difference in behavior of such 
> similar patterns.
>
> regards,
>
> -- 
> Jean-Pierre
> Le vendredi 30 avril 2021 à 07:15:37 UTC+2, TW Tones a écrit :
>
>> Jean-Pierre;
>>
>> I am not sure about your requirement, but try these
>>
>> <$list filter="[enlist[a1^a2 b1^b2 c1^c2]]">
>>{{{ [split[^]first[]] }}}
>> 
>> 
>> <$list filter="[enlist[a1^a2 b1^b2 c1^c2]]">
>><$list filter="[split[^]first[]]">
>>
>>
>> 
>> 
>> <$list filter="[enlist[a1^a2 b1^b2 c1^c3]split[^]]">
>>
>> 
>> 
>> <$list filter="[[a1^a2 b1^b2 c1^c3]split[ ]split[^]]">
>>
>> 
>>
>> I was recently considering a similar problem, when someone was 
>> questioning nesting list widgets, when I realised the $list with filters 
>> can act as gosub, while, do until etc... so nesting them is by definition 
>> sometimes a logical requirement depending what you are trying to achieve 
>> with your filters. Nesting is not easy or possible in many cases with 
>> triple curly braces.
>>
>> Regards
>> Tones
>>
>> On Friday, 30 April 2021 at 07:15:04 UTC+10 jn.pierr...@gmail.com wrote:
>>
>>> Toying with filters, I discovered that the split operator agglomerates 
>>> its results when ist operates on successive titles.
>>>
>>> for instance : {{{ [enlist[a1^a2 b1^b2 c1^c2]split[^][]first[]] }}}
>>> results in a1 not in a1, b1, c1
>>>
>>> a sufilter dos not change anything:
>>>
>>> <$vars sf="[split[^]dump[]first[]]">
>>> {{{ [enlist[a1^a2 b1^b2 c1^c2]subfilter] }}}
>>> 
>>>
>>> In fact, in each case, after split, the filter values are a1, a2, b1, 
>>> b2, c1, c2.
>>>
>>> could there be a way to have [a1, a2], [b1, b2], [c1, c2] 
>>> from enlist[a1^a2 b1^b2 c1^c2] ?
>>>
>>> let's use sortsub and a little input set to see that what I am asking 
>>> for may not be that impossible.
>>>
>>> <$vars sf="[split[^]dump[]last[]]">
>>> {{{ [enlist[a1^22 b1^28 c1^14]sortsub] }}}
>>> 
>>>
>>> reults in c1^14, a1^22, b1^28
>>>
>>> which demonstrate that here split produces things like c1, 14 on which 
>>> split act upon. exactly what I wanted to achieve with subfilter.
>>>
>>> -- 
>>> Jean-Pierre
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/db9f9535-8783-4cdf-8b10-874fee0482een%40googlegroups.com.


[tw5] Re: split agglomerates

2021-04-30 Thread Jean-Pierre Rivière
Nestling, in such a way anyway, is something I had not thought about.

In fact, this is only a part of the pipeline. Can I get back a united 
output afterwards? I'll experiment and if I'm at loss, I'll post again.

A question remains for me: Why is "split + last" apparently working on so 
different data when called by sortsub or subfilter? Aren't they just 
calling a filter? What is causing the diffirence? I think it would be wise 
and good for me to understand what cause the difference in behavior of such 
similar patterns.

regards,

-- 
Jean-Pierre
Le vendredi 30 avril 2021 à 07:15:37 UTC+2, TW Tones a écrit :

> Jean-Pierre;
>
> I am not sure about your requirement, but try these
>
> <$list filter="[enlist[a1^a2 b1^b2 c1^c2]]">
>{{{ [split[^]first[]] }}}
> 
> 
> <$list filter="[enlist[a1^a2 b1^b2 c1^c2]]">
><$list filter="[split[^]first[]]">
>
>
> 
> 
> <$list filter="[enlist[a1^a2 b1^b2 c1^c3]split[^]]">
>
> 
> 
> <$list filter="[[a1^a2 b1^b2 c1^c3]split[ ]split[^]]">
>
> 
>
> I was recently considering a similar problem, when someone was questioning 
> nesting list widgets, when I realised the $list with filters can act as 
> gosub, while, do until etc... so nesting them is by definition sometimes a 
> logical requirement depending what you are trying to achieve with your 
> filters. Nesting is not easy or possible in many cases with triple curly 
> braces.
>
> Regards
> Tones
>
> On Friday, 30 April 2021 at 07:15:04 UTC+10 jn.pierr...@gmail.com wrote:
>
>> Toying with filters, I discovered that the split operator agglomerates 
>> its results when ist operates on successive titles.
>>
>> for instance : {{{ [enlist[a1^a2 b1^b2 c1^c2]split[^][]first[]] }}}
>> results in a1 not in a1, b1, c1
>>
>> a sufilter dos not change anything:
>>
>> <$vars sf="[split[^]dump[]first[]]">
>> {{{ [enlist[a1^a2 b1^b2 c1^c2]subfilter] }}}
>> 
>>
>> In fact, in each case, after split, the filter values are a1, a2, b1, b2, 
>> c1, c2.
>>
>> could there be a way to have [a1, a2], [b1, b2], [c1, c2] 
>> from enlist[a1^a2 b1^b2 c1^c2] ?
>>
>> let's use sortsub and a little input set to see that what I am asking for 
>> may not be that impossible.
>>
>> <$vars sf="[split[^]dump[]last[]]">
>> {{{ [enlist[a1^22 b1^28 c1^14]sortsub] }}}
>> 
>>
>> reults in c1^14, a1^22, b1^28
>>
>> which demonstrate that here split produces things like c1, 14 on which 
>> split act upon. exactly what I wanted to achieve with subfilter.
>>
>> -- 
>> Jean-Pierre
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/6e757ebd-4513-4dbd-849c-b314d54f7cfen%40googlegroups.com.


[tw5] Re: split agglomerates

2021-04-30 Thread Jean-Pierre Rivière
Thank you Mark! This is a clever trick. Definitely worth remembering.

Le jeudi 29 avril 2021 à 23:51:53 UTC+2, Mark S. a écrit :

> It's often the case that we need two nested listwidgets to break down the 
> results the way we want. In your example, everything is split by ^, but 
> then it picks the first item from the resulting list (a1).  You could 
> instead split by space, send the result to an inner loop, and then split by 
> ^ .
>
> But in this case, you could use splitregexp :
>
> {{{ [enlist[a1^a2 b1^b2 c1^c2]splitregexp[\^\w\w]] }}}
>
> a1,  b1, c1
>
> On Thursday, April 29, 2021 at 2:15:04 PM UTC-7 jn.pierr...@gmail.com 
> wrote:
>
>> Toying with filters, I discovered that the split operator agglomerates 
>> its results when ist operates on successive titles.
>>
>> for instance : {{{ [enlist[a1^a2 b1^b2 c1^c2]split[^][]first[]] }}}
>> results in a1 not in a1, b1, c1
>>
>> a sufilter dos not change anything:
>>
>> <$vars sf="[split[^]dump[]first[]]">
>> {{{ [enlist[a1^a2 b1^b2 c1^c2]subfilter] }}}
>> 
>>
>> In fact, in each case, after split, the filter values are a1, a2, b1, b2, 
>> c1, c2.
>>
>> could there be a way to have [a1, a2], [b1, b2], [c1, c2] 
>> from enlist[a1^a2 b1^b2 c1^c2] ?
>>
>> let's use sortsub and a little input set to see that what I am asking for 
>> may not be that impossible.
>>
>> <$vars sf="[split[^]dump[]last[]]">
>> {{{ [enlist[a1^22 b1^28 c1^14]sortsub] }}}
>> 
>>
>> reults in c1^14, a1^22, b1^28
>>
>> which demonstrate that here split produces things like c1, 14 on which 
>> split act upon. exactly what I wanted to achieve with subfilter.
>>
>> -- 
>> Jean-Pierre
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/eb956ad4-d0ae-4274-872e-772da48aa4c9n%40googlegroups.com.


[tw5] Re: split agglomerates

2021-04-29 Thread TW Tones
Jean-Pierre;

I am not sure about your requirement, but try these

<$list filter="[enlist[a1^a2 b1^b2 c1^c2]]">
   {{{ [split[^]first[]] }}}


<$list filter="[enlist[a1^a2 b1^b2 c1^c2]]">
   <$list filter="[split[^]first[]]">

   


<$list filter="[enlist[a1^a2 b1^b2 c1^c3]split[^]]">



<$list filter="[[a1^a2 b1^b2 c1^c3]split[ ]split[^]]">



I was recently considering a similar problem, when someone was questioning 
nesting list widgets, when I realised the $list with filters can act as 
gosub, while, do until etc... so nesting them is by definition sometimes a 
logical requirement depending what you are trying to achieve with your 
filters. Nesting is not easy or possible in many cases with triple curly 
braces.

Regards
Tones

On Friday, 30 April 2021 at 07:15:04 UTC+10 jn.pierr...@gmail.com wrote:

> Toying with filters, I discovered that the split operator agglomerates its 
> results when ist operates on successive titles.
>
> for instance : {{{ [enlist[a1^a2 b1^b2 c1^c2]split[^][]first[]] }}}
> results in a1 not in a1, b1, c1
>
> a sufilter dos not change anything:
>
> <$vars sf="[split[^]dump[]first[]]">
> {{{ [enlist[a1^a2 b1^b2 c1^c2]subfilter] }}}
> 
>
> In fact, in each case, after split, the filter values are a1, a2, b1, b2, 
> c1, c2.
>
> could there be a way to have [a1, a2], [b1, b2], [c1, c2] 
> from enlist[a1^a2 b1^b2 c1^c2] ?
>
> let's use sortsub and a little input set to see that what I am asking for 
> may not be that impossible.
>
> <$vars sf="[split[^]dump[]last[]]">
> {{{ [enlist[a1^22 b1^28 c1^14]sortsub] }}}
> 
>
> reults in c1^14, a1^22, b1^28
>
> which demonstrate that here split produces things like c1, 14 on which 
> split act upon. exactly what I wanted to achieve with subfilter.
>
> -- 
> Jean-Pierre
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/dee3f113-7a2b-40a4-b6e9-c0339326160cn%40googlegroups.com.


[tw5] Re: split agglomerates

2021-04-29 Thread 'Mark S.' via TiddlyWiki
It's often the case that we need two nested listwidgets to break down the 
results the way we want. In your example, everything is split by ^, but 
then it picks the first item from the resulting list (a1).  You could 
instead split by space, send the result to an inner loop, and then split by 
^ .

But in this case, you could use splitregexp :

{{{ [enlist[a1^a2 b1^b2 c1^c2]splitregexp[\^\w\w]] }}}

a1,  b1, c1

On Thursday, April 29, 2021 at 2:15:04 PM UTC-7 jn.pierr...@gmail.com wrote:

> Toying with filters, I discovered that the split operator agglomerates its 
> results when ist operates on successive titles.
>
> for instance : {{{ [enlist[a1^a2 b1^b2 c1^c2]split[^][]first[]] }}}
> results in a1 not in a1, b1, c1
>
> a sufilter dos not change anything:
>
> <$vars sf="[split[^]dump[]first[]]">
> {{{ [enlist[a1^a2 b1^b2 c1^c2]subfilter] }}}
> 
>
> In fact, in each case, after split, the filter values are a1, a2, b1, b2, 
> c1, c2.
>
> could there be a way to have [a1, a2], [b1, b2], [c1, c2] 
> from enlist[a1^a2 b1^b2 c1^c2] ?
>
> let's use sortsub and a little input set to see that what I am asking for 
> may not be that impossible.
>
> <$vars sf="[split[^]dump[]last[]]">
> {{{ [enlist[a1^22 b1^28 c1^14]sortsub] }}}
> 
>
> reults in c1^14, a1^22, b1^28
>
> which demonstrate that here split produces things like c1, 14 on which 
> split act upon. exactly what I wanted to achieve with subfilter.
>
> -- 
> Jean-Pierre
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/ef7168c8-3f38-406c-a829-bb55f4025073n%40googlegroups.com.