frangipanni icon indicating copy to clipboard operation
frangipanni copied to clipboard

Add -auto-order option

Open birchb1024 opened this issue 2 years ago • 1 comments

If the -auto-order option is given, then assess the relative 'value' of each token at each level. Re-order the input and re do so that the hierarchy makes more sense. For example one way to re-order is to place tokens with higher counts higher in the hierarchy. Thought-experiment. Given:

12:34  01-01-2022 
12:43  01-01-2022 
12:45  01-01-2022 
12:50  01-01-2022 
00:10  02-01-2022 
00:12  02-01-2022 
00:34  02-01-2022 

We want

frangipanni -no-fold -counts
2022: 7
    01: 7
        01: 4
            12: 4
                34: 1
                43: 1
                45: 1
                50: 1
        02: 3
            00: 3
                10: 1
                12: 1
                34: 1

But as you can see there is ambiguity here, how do we know what the output order is, in fact?

birchb1024 avatar Oct 20 '22 04:10 birchb1024

Maybe this needs to be in a seperate filter, ie <data.csv auto-reorder | frangipanni. Perhaps the concept of re-ordering columns only makes sense for tabular data. Frangipanni does not have any concept of rows (lines) being organised into columns, it assumes they are all diverse. Hmmm...

birchb1024 avatar Oct 20 '22 04:10 birchb1024