@Test
    void testRuleReading() throws java.io.IOException, ParseException {
        RuleBase rules = new RuleImporter(new SimpleLinguistics()).importFile(ROOT + "rules.sr");
        Iterator<?> i = rules.ruleIterator();
        assertEquals("[listing] [preposition] [place] -> listing:[listing] place:[place]!150",
                i.next().toString());
        assertEquals("[listing] [place] +> place:[place]",
                i.next().toString());
        assertEquals("[brand] -> brand:[brand]",
                i.next().toString());
        assertEquals("[category] -> category:[category]",
                i.next().toString());
        assertEquals("digital camera -> digicamera",
                i.next().toString());
        assertEquals("(parameter.ranking='cat'), (parameter.ranking='cat0') -> one", i.next().toString());
        assertFalse(i.hasNext());

        i = rules.conditionIterator();
        assertEquals("[listing] :- restaurant, shop, cafe, hotel",
                i.next().toString());
        assertEquals("[preposition] :- in, at, near",
                i.next().toString());
        assertEquals("[place] :- geary",
                i.next().toString());
        assertEquals("[brand] :- sony, dell",
                i.next().toString());
        assertEquals("[category] :- digital camera, camera, phone",
                i.next().toString());
        assertFalse(i.hasNext());

        assertTrue(rules.isDefault());
        assertEquals(ROOT + "semantics.fsa", rules.getAutomataFile());
    }
Tests parsing of semantic rules bases

@author bratseth
container-search/src/test/java/com/yahoo/prelude/semantics/parser/test/SemanticsParserTestCase.java