Sha256: 00add7ed3c631847e2e6911dd02ed2e1ef60a9c879f435bda24a37786da0b7a2
Contents?: true
Size: 614 Bytes
Versions: 84
Compression:
Stored size: 614 Bytes
Contents
-module(etl). -export([transform/1]). transform(OldValue) -> orddict:to_list( orddict:from_list( lists:flatten( invert(OldValue) ) ) ). invert(Pairs) -> lists:foldl( fun({Key, Values}, A) -> lists:foldl( fun(Value, Acc) -> orddict:update( string:to_lower(Value), fun (Old) -> lists:flatten([Old] ++ [Key]) end, Key, Acc ) end, A, Values ) end, orddict:new(), Pairs ).
Version data entries
84 entries across 84 versions & 1 rubygems