Skip to content

Commit

Permalink
add endpoint to get back JSON from TEI
Browse files Browse the repository at this point in the history
  • Loading branch information
lfoppiano committed Apr 22, 2024
1 parent 67dfa81 commit c164c48
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/grobid/core/engines/DatasetParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ public String processXML(File file) throws Exception {
}

/**
* Extract all software mentions from a publisher XML file
* Extract all software mentions from a TEI XML file
*/
public Pair<List<List<Dataset>>, List<BibDataSet>> processTEIDocument(org.w3c.dom.Document doc,
boolean disambiguate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,16 @@ public Response processTEI(
return DatastetProcessFile.processTEI(inputStream, segmentSentences);
}

@Path(PATH_DATASEER_TEI)
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_JSON)
@POST
public Response processTEIJsonOutput(
@FormDataParam(INPUT) InputStream inputStream,
@FormDataParam("segmentSentences") String segmentSentences) {
return DatastetProcessFile.extractTEI(inputStream, false, true);
}

@Path(PATH_DATASEER_JATS)
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_XML)
Expand Down

0 comments on commit c164c48

Please sign in to comment.