@Test public void normalize_hard() { assertEquals("J. Stanisław Łowak", judgeNameNormalizer.normalize("gen. sn J. Stanisław Łowak-spr")); assertEquals("J. Stanisław Łowak", judgeNameNormalizer.normalize("SR (del.) J. Stanisław Łowak (Sprawozdawca)")); assertEquals("Hanna Witkowska-Zalewska", judgeNameNormalizer.normalize("w w Gdańsku Hanna Witkowska-Zalewska")); assertEquals("Andrzej Tomczyk", judgeNameNormalizer.normalize("Sędzia WSO del. do SN ppłk Andrzej Tomczyk")); assertEquals("Anna Pelc", judgeNameNormalizer.normalize("Anna Pelc (spr.)aw)")); assertEquals("Sylwia Kornatowicz", judgeNameNormalizer.normalize("Sylwia Kornatowicz (spr.)awozdanie)")); assertEquals("Daniel Błaszak", judgeNameNormalizer.normalize("W(del) Daniel Błaszak-")); assertEquals("Regina Owczarek-Jędrasik", judgeNameNormalizer.normalize("Sędzia S A Regina Owczarek – Jędrasik / spraw./")); assertEquals("Bartosz Kaźmierak", judgeNameNormalizer.normalize("p.o. Sędziego Bartosz Kaźmierak")); assertEquals("Wiesław Żywolewski", judgeNameNormalizer.normalize("Wiesław Żywolewski (s. ref.)")); assertEquals("Urszula Sipińska-Sęk", judgeNameNormalizer.normalize("Sędzia S R () Urszula Sipińska-Sęk")); assertEquals("Izabela Bluszcz", judgeNameNormalizer.normalize("Protokolant Sekr. Sąd. Izabela Bluszcz")); assertEquals("Anna Hordyńska", judgeNameNormalizer.normalize("Anna Hordyńska – ref.")); assertEquals("Szczęsny Szymański", judgeNameNormalizer.normalize("Szczęsny Szymański (s. ref)")); assertEquals("Adrianna Szewczyk-Kubat", judgeNameNormalizer.normalize("Adrianna Szewczyk –Kubat /ref/")); assertEquals("W. Damaszko", judgeNameNormalizer.normalize("Sędzia-W. Damaszko")); assertEquals("Barbara Baran", judgeNameNormalizer.normalize("Barbara Baran (deleg.) – spraw.")); }
public String normalize(String judgeName) { if (StringUtils.isBlank(judgeName)) { return ""; } judgeName = PersonNameNormalizer.normalize(judgeName); judgeName = StringTools.toRootLowerCase(judgeName); judgeName = removeDefinedParts(judgeName); judgeName = removeTrailingDashes(judgeName); judgeName = removeTrailingDots(judgeName); return PersonNameNormalizer.normalize(judgeName); }
JudgeNameNormalizer { public String normalize(String judgeName) { if (StringUtils.isBlank(judgeName)) { return ""; } judgeName = PersonNameNormalizer.normalize(judgeName); judgeName = StringTools.toRootLowerCase(judgeName); judgeName = removeDefinedParts(judgeName); judgeName = removeTrailingDashes(judgeName); judgeName = removeTrailingDots(judgeName); return PersonNameNormalizer.normalize(judgeName); } }
JudgeNameNormalizer { public String normalize(String judgeName) { if (StringUtils.isBlank(judgeName)) { return ""; } judgeName = PersonNameNormalizer.normalize(judgeName); judgeName = StringTools.toRootLowerCase(judgeName); judgeName = removeDefinedParts(judgeName); judgeName = removeTrailingDashes(judgeName); judgeName = removeTrailingDots(judgeName); return PersonNameNormalizer.normalize(judgeName); }  }
JudgeNameNormalizer { public String normalize(String judgeName) { if (StringUtils.isBlank(judgeName)) { return ""; } judgeName = PersonNameNormalizer.normalize(judgeName); judgeName = StringTools.toRootLowerCase(judgeName); judgeName = removeDefinedParts(judgeName); judgeName = removeTrailingDashes(judgeName); judgeName = removeTrailingDots(judgeName); return PersonNameNormalizer.normalize(judgeName); }  String normalize(String judgeName); @PostConstruct void postConstruct(); void setPartsToRemove(String[] partsToRemove); void setRegexesToRemove(String[] regexesToRemove); }
JudgeNameNormalizer { public String normalize(String judgeName) { if (StringUtils.isBlank(judgeName)) { return ""; } judgeName = PersonNameNormalizer.normalize(judgeName); judgeName = StringTools.toRootLowerCase(judgeName); judgeName = removeDefinedParts(judgeName); judgeName = removeTrailingDashes(judgeName); judgeName = removeTrailingDots(judgeName); return PersonNameNormalizer.normalize(judgeName); }  String normalize(String judgeName); @PostConstruct void postConstruct(); void setPartsToRemove(String[] partsToRemove); void setRegexesToRemove(String[] regexesToRemove);  }