levelModifier = pp.getSection(0).getLevel()-1;
private void addPageExamples(ParsedPage parsedPage, ParsedPageTitle parsedPageTitle) //throws IOException { try { if (!disambiguationPageSet.contains(parsedPageTitle.getPage())) { Section firstSection = parsedPage.getSection(0); String leftContext = EMPTY_CONTEXT; String rightContext = EMPTY_CONTEXT; if (firstSection != null) { rightContext = firstSection.getText(); } if (parsedPageTitle.hasSuffix()) { leftContext = parsedPageTitle.getSuffix(); } if (parsedPageTitle.isCompliant()) { Example example = new Example(parsedPageTitle.getForm(), parsedPageTitle.getPage(), parsedPageTitle.getPage(), leftContext, rightContext, Example.CONTENT_FROM_PAGE); addExample(example); addNominalVariantExample(example); addPersonSurnameExample(example); addRedirectPageExamples(example, parsedPageTitle); //logger.debug(parsedPageTitle.getForm() + "\t" + parsedPageTitle.getPage() + "\tKEEP"); } else { //logger.warn(parsedPageTitle.getForm() + "\t" + parsedPageTitle.getPage() + "\tREMOVED"); } } } catch (Exception ex) { logger.error("Exception adding page examples for page " + parsedPageTitle.getPage() + " (" + exampleCounter.intValue() + ")\n" + ex); } }