An integrated, dual learner for grammars and ontologies