unifierConfig.setEquivalence("number", "plural",
preparePOSElement(".*[\\.:]pl:.*"));
final Unifier uni = unifierConfig.createUnifier();
final AnalyzedToken sing1 = new AnalyzedToken("mały", "adj:sg:blahblah", "mały");
final AnalyzedToken sing2 = new AnalyzedToken("człowiek", "subst:sg:blahblah", "człowiek");
final Map<String, List<String>> equiv = new HashMap<>();
final List<String> list1 = new ArrayList<>();
list1.add("singular");
equiv.put("number", list1);
boolean satisfied = uni.isSatisfied(sing1, equiv);
uni.startUnify();
satisfied &= uni.isSatisfied(sing2, equiv);
satisfied &= uni.getFinalUnificationValue(equiv);
assertEquals(true, satisfied);
uni.reset();
//for multiple readings - OR for interpretations, AND for tokens
AnalyzedToken sing1a = new AnalyzedToken("mały", "adj:pl:blahblah", "mały");
satisfied = uni.isSatisfied(sing1, equiv);
satisfied |= uni.isSatisfied(sing1a, equiv);
uni.startUnify();
satisfied &= uni.isSatisfied(sing2, equiv);
satisfied &= uni.getFinalUnificationValue(equiv);
assertEquals(true, satisfied);
uni.reset();
//check if any of the equivalences is there
list1.add("plural");
equiv.clear();
equiv.put("number", list1);
sing1a = new AnalyzedToken("mały", "adj:pl:blahblah", "mały");
satisfied = uni.isSatisfied(sing1, equiv);
satisfied |= uni.isSatisfied(sing1a, equiv);
uni.startUnify();
satisfied &= uni.isSatisfied(sing2, equiv);
satisfied &= uni.getFinalUnificationValue(equiv);
assertEquals(true, satisfied);
uni.reset();
//now test all possible feature equivalences by leaving type blank
sing1a = new AnalyzedToken("mały", "adj:pl:blahblah", "mały");
equiv.clear();
equiv.put("number", null);
satisfied = uni.isSatisfied(sing1, equiv);
satisfied |= uni.isSatisfied(sing1a, equiv);
uni.startUnify();