I have a
Lookup
where the TElement refers to a string of words. I want to convert Lookup into:
A lookup is a collection of mappings from a key to a collection of values. Given a key you can get the collection of associated values:
TKey key;
Lookup lookup;
IEnumerable values = lookup[key];
As it implements IEnumerable
Lookup lookup = //whatever
Dictionary dict = lookup.ToDictionary(grp => grp.Key, grp => grp.ToArray());
List> lists = lookup.Select(grp => grp.ToList()).ToList();