ReferenceTagger { public static String createFigId(final String text){ Matcher figMatcher = PATENT_FIG.matcher(text); StringBuilder stb = new StringBuilder(); if (figMatcher.matches()){ stb.append("FIG-"); stb.append(figMatcher.group(2)); if (figMatcher.group(3) != null){ stb.append(",").append("FIG-").append(figMatcher.group(4)); } } return stb.toString(); }  static String markRefs(final String rawText); static String createClaimId(final String text); static String createFigId(final String text); static String normRefs(final String text);  }
@Test public void createFigId() { String figId = ReferenceTagger.createFigId("Fig. 1A"); String expect = "FIG-1A"; assertEquals(expect, figId); }
@Test public void createFigIdMulti() { String figId = ReferenceTagger.createFigId("FIGS. 1A and 1B"); String expect = "FIG-1A,FIG-1B"; assertEquals(expect, figId); }