CogComp / saul

Saul : Declarative Learning-Based Programming
Other
64 stars 18 forks source link

A specialized GroupBy operation for Saul #291

Open kordjamshidi opened 8 years ago

kordjamshidi commented 8 years ago

Using Scala collection operation we can easily GroupBy nodes with a specific property as follows:

nodex().GroupBy(propertyx(_))

However, since our properties can output Scala Lists then it would be helpful to have a GroupBy that makes groups based on the values in the List. See here: https://github.com/IllinoisCogComp/saul/blob/forSmallPRs/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/DrugResponse/KnowEngDataModel.scala#L73

kordjamshidi commented 8 years ago

It seems this works, we need to make it infix though: See here

kordjamshidi commented 8 years ago

Can you help to be able to write this SGroupBy(node1, property1, property2)

as follows?

node1 SGroupBy property1 Select property2 @danyaljj @sameersingh This would mean grouping nodes based on property1 and then groups are represented by property1's value as a key and a List of property2 is shown for each group.