I'm writing code to answer multiple-choice SAT analogy questions.
A design issue:
Where to put the givenAnswer:
* inside the AnalogyQuestion object
* outside, using some kind of Hash < AnalogyQuestion,int >
---
I think the class Hash < A,B > should have an argmax() method, returning the A for which B is maximum, whenever B has a Comparator. Or more generally, we should have an argmax() function to which you pass the list and a closure specifying how to get the property that is being compared.
I haven't been able to find a nice solution. This is annoying.
A design issue:
Where to put the givenAnswer:
* inside the AnalogyQuestion object
* outside, using some kind of Hash < AnalogyQuestion,int >
---
I think the class Hash < A,B > should have an argmax() method, returning the A for which B is maximum, whenever B has a Comparator. Or more generally, we should have an argmax() function to which you pass the list and a closure specifying how to get the property that is being compared.
I haven't been able to find a nice solution. This is annoying.