sclass Splitter1 {
new MultiSet aExamples;
new MultiSet bExamples;
// 1 for A, 2 for B, 0 for unknown
int get(A a) {
int i = aExamples.get(a)-bExamples.get(a);
ret i > 0 ? 1 : i < 0 ? 2 : 0;
}
void learn(A a, bool isB) {
(isB ? bExamples : aExamples).add(a);
}
void clear { aExamples.clear(); bExamples.clear(); }
}