Preprocess extends InternalModule { protected String expandAbbreviation(String abbrev, boolean isCapital) { String expAbb = abbrev.replaceAll("\\.", "").toLowerCase(); if (!abbrevMap.containsKey(expAbb)) { logger.warn(String.format("Could not expand unknown abbreviation \"%s\", ignoring", abbrev)); return abbrev; } expAbb = (String) abbrevMap.get(expAbb); String[] multiExp = expAbb.split(","); if (multiExp.length > 1) { if (isCapital) { expAbb = multiExp[0]; } else { expAbb = multiExp[1]; } } return expAbb; } Preprocess(); static Map<Object, Object> loadAbbrevMap(); MaryData process(MaryData d);  }
@Test public void testExpandUnknownAbbrev() { String word = "qlsv234toinsdcsdl."; String actual = module.expandAbbreviation(word, false); Assert.assertEquals(actual, word); }