@Test public void extractFigDesc2() { String pargraphText = "Image 1 is a partial perspective view of a person wearing a suitcoat."; List<Figure> figures = new ArrayList<Figure>(); DescriptionFigures.findFigures(pargraphText, figures); assertTrue(figures.isEmpty()); }
public static void findFigures(String pargraphText, List<Figure> figureList) { Figure figure = null; int figEnd = 0; String figText = ""; Matcher matchFig = PATENT_FIG.matcher(pargraphText); if (matchFig.lookingAt()) { String id = matchFig.group(1); if (!id.equals(pargraphText)) { figEnd = matchFig.end(); figText = pargraphText.substring(figEnd + 1); figure = new Figure(figText, id); } } else { Matcher matchFigs = PATENT_FIGS.matcher(pargraphText); if (matchFigs.lookingAt()) { String id = matchFigs.group(1); if (!id.equals(pargraphText)) { figEnd = matchFigs.end(); figText = pargraphText.substring(figEnd + 1); Figure fig = new Figure(figText, id); figureList.add(fig); } } else { if (pargraphText.matches("^FIG")) { LOGGER.warn("Unable to Parse Patent Figure ID: '" + pargraphText); } else { LOGGER.trace("2. Unable to Parse Patent Figure ID: '" + pargraphText); } } } if (figure != null) { figureList.add(figure); } }
DescriptionFigures extends ItemReader<List<Figure>> { public static void findFigures(String pargraphText, List<Figure> figureList) { Figure figure = null; int figEnd = 0; String figText = ""; Matcher matchFig = PATENT_FIG.matcher(pargraphText); if (matchFig.lookingAt()) { String id = matchFig.group(1); if (!id.equals(pargraphText)) { figEnd = matchFig.end(); figText = pargraphText.substring(figEnd + 1); figure = new Figure(figText, id); } } else { Matcher matchFigs = PATENT_FIGS.matcher(pargraphText); if (matchFigs.lookingAt()) { String id = matchFigs.group(1); if (!id.equals(pargraphText)) { figEnd = matchFigs.end(); figText = pargraphText.substring(figEnd + 1); Figure fig = new Figure(figText, id); figureList.add(fig); } } else { if (pargraphText.matches("^FIG")) { LOGGER.warn("Unable to Parse Patent Figure ID: '" + pargraphText); } else { LOGGER.trace("2. Unable to Parse Patent Figure ID: '" + pargraphText); } } } if (figure != null) { figureList.add(figure); } } }
DescriptionFigures extends ItemReader<List<Figure>> { public static void findFigures(String pargraphText, List<Figure> figureList) { Figure figure = null; int figEnd = 0; String figText = ""; Matcher matchFig = PATENT_FIG.matcher(pargraphText); if (matchFig.lookingAt()) { String id = matchFig.group(1); if (!id.equals(pargraphText)) { figEnd = matchFig.end(); figText = pargraphText.substring(figEnd + 1); figure = new Figure(figText, id); } } else { Matcher matchFigs = PATENT_FIGS.matcher(pargraphText); if (matchFigs.lookingAt()) { String id = matchFigs.group(1); if (!id.equals(pargraphText)) { figEnd = matchFigs.end(); figText = pargraphText.substring(figEnd + 1); Figure fig = new Figure(figText, id); figureList.add(fig); } } else { if (pargraphText.matches("^FIG")) { LOGGER.warn("Unable to Parse Patent Figure ID: '" + pargraphText); } else { LOGGER.trace("2. Unable to Parse Patent Figure ID: '" + pargraphText); } } } if (figure != null) { figureList.add(figure); } } DescriptionFigures(Node itemNode); }
DescriptionFigures extends ItemReader<List<Figure>> { public static void findFigures(String pargraphText, List<Figure> figureList) { Figure figure = null; int figEnd = 0; String figText = ""; Matcher matchFig = PATENT_FIG.matcher(pargraphText); if (matchFig.lookingAt()) { String id = matchFig.group(1); if (!id.equals(pargraphText)) { figEnd = matchFig.end(); figText = pargraphText.substring(figEnd + 1); figure = new Figure(figText, id); } } else { Matcher matchFigs = PATENT_FIGS.matcher(pargraphText); if (matchFigs.lookingAt()) { String id = matchFigs.group(1); if (!id.equals(pargraphText)) { figEnd = matchFigs.end(); figText = pargraphText.substring(figEnd + 1); Figure fig = new Figure(figText, id); figureList.add(fig); } } else { if (pargraphText.matches("^FIG")) { LOGGER.warn("Unable to Parse Patent Figure ID: '" + pargraphText); } else { LOGGER.trace("2. Unable to Parse Patent Figure ID: '" + pargraphText); } } } if (figure != null) { figureList.add(figure); } } DescriptionFigures(Node itemNode); @Override List<Figure> read(); static void findFigures(String pargraphText, List<Figure> figureList); }
DescriptionFigures extends ItemReader<List<Figure>> { public static void findFigures(String pargraphText, List<Figure> figureList) { Figure figure = null; int figEnd = 0; String figText = ""; Matcher matchFig = PATENT_FIG.matcher(pargraphText); if (matchFig.lookingAt()) { String id = matchFig.group(1); if (!id.equals(pargraphText)) { figEnd = matchFig.end(); figText = pargraphText.substring(figEnd + 1); figure = new Figure(figText, id); } } else { Matcher matchFigs = PATENT_FIGS.matcher(pargraphText); if (matchFigs.lookingAt()) { String id = matchFigs.group(1); if (!id.equals(pargraphText)) { figEnd = matchFigs.end(); figText = pargraphText.substring(figEnd + 1); Figure fig = new Figure(figText, id); figureList.add(fig); } } else { if (pargraphText.matches("^FIG")) { LOGGER.warn("Unable to Parse Patent Figure ID: '" + pargraphText); } else { LOGGER.trace("2. Unable to Parse Patent Figure ID: '" + pargraphText); } } } if (figure != null) { figureList.add(figure); } } DescriptionFigures(Node itemNode); @Override List<Figure> read(); static void findFigures(String pargraphText, List<Figure> figureList);  }