@Before public void setUp() { parser.setPrecedenceBound(0); postProcessorExists = false; for (QueryDataTransformer t : parser.getPostProcessors()) { if (t instanceof ComponentSearchRelationNormalizer) { postProcessorExists = true; break; } } }
@Test public void testUniqueNameForDoubleNormalized() { Assume.assumeTrue(postProcessorExists); String aql = "cat=/(S|.P)/ >[func=/M(O|NR)/] cat=\"PP\" & #2 >[func=\"AC\"] lemma=\"an\" & #3 _=_ pos=/APPR(ART)?/ & #2 >[func=\"NK\"] pos=\"NN\""; // perform the initial parsing QueryData data = parser.parse(aql, new LinkedList<Long>()); Assert.assertEquals(1, data.getAlternatives().size()); List<QueryNode> alt = data.getAlternatives().get(0); Assert.assertEquals(7, alt.size()); Assert.assertEquals(6, alt.get(5).getId()); Assert.assertEquals("x6(2)", alt.get(5).getVariable()); Assert.assertEquals(7, alt.get(6).getId()); Assert.assertEquals("x7(2)", alt.get(6).getVariable()); }