I have what I think is a fairly simple use-case, but FME doesn't currently has the tools necessary to readily implement it. So this is a transformer suggestion for a ListAttributeMapper or something to that effect.
Basically I have a list like this:
_list{0}.class = 1
_list{1}.class = 2
_list{2}.class = 3
_list{3}.class = 5
_list{4}.class = 2
_list{5}.class = 1
I need to know how many of any given class there are with the feature. ListHistogrammer does this nicely:
_histo{0}.value = 1
_histo{0}.count = 2
_histo{1}.value = 2
_histo{1}.count = 2
_histo{2}.value = 3
_histo{2}.count = 1
_histo{3}.value = 5
_histo{3}.count = 1
My problem then is turning those into arbitrarily named attributes without a needlessly complex set of testers, let alone a PythonCaller.
I want my output feature to have attributes like these:
first_class = 2
other_thing = 2
third_item = 1
fourth_item = <missing>
final = 1
A kind of ListAttributeMapper would be one way to solve this. You'd point it at _histo{}.value, and for any given value in that field, tell it into what attribute name to to put the index equivalent value of _histo{}.count
Hopefully that's clear