/** * Invoke lemma post-processors * * @param lemma * @param wfMap mutable map of wordform_string => set_of_wordform_objects * @return true if given lemma must be accepted, false - otherwise. */ private boolean postProcessLemma(Lemma.Builder lemmaBuilder, Multimap<String, Wordform> wfMap) { for (LemmaPostProcessor filter : lemmaPostProcessors) { if (!filter.process(dict, lemmaBuilder, wfMap)) { return false; } } return true; }
@Override public void endDocument() throws SAXException { log.info("The dictionary xml parsing is finished. Firing 'dictionaryParsed' event..."); for (LemmaPostProcessor lpp : lemmaPostProcessors) { lpp.dictionaryParsed(dict); } // sanity check if (!elemStack.isEmpty()) { throw new IllegalStateException("Elem stack is not empty at the end: " + elemStack); } log.info( "Lemmas accepted: {}\nLemmas rejected: {}", acceptedLemmaCounter, rejectedLemmaCounter); dict.complete(); finished = true; }