Skip to content

Commit

Permalink
changes to handle grobid
Browse files Browse the repository at this point in the history
changes to handle grobid and warn when the extractors in the xml file doesnt belong to"svm header parse", "grobid" or "parscit"
  • Loading branch information
bharathgit956 committed Nov 25, 2019
1 parent 2611627 commit 0f886cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,14 @@ public static edu.psu.citeseerx.domain.Document map(Element root)
FileInfoMapper.map(doc, child);
}
if (child.getName().equals("algorithm")) {
if (child.getAttributeValue("name").equals("SVM HeaderParse")) {
if (child.getAttributeValue("name").equals("SVM HeaderParse") || child.getAttributeValue("name").contains("GROBID")) {
ParsHedMapper.map(doc, child);
}
if (child.getAttributeValue("name").equals("ParsCit")) {
}else if (child.getAttributeValue("name").equals("ParsCit")) {
ParscitMapper.map(doc, child);
}else {
System.err.println("WARNING : Algorithm name attribute is not what " +
"was expected: found "+child.getName()+
", expected SVM HeaderParse, ParsCit or GROBID");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ public static Document map(String xml)
public static void map(Document doc, Element root)
throws MappingException {

if (!root.getAttributeValue("name").equals(ALG_NAME)) {
if (!root.getAttributeValue("name").equals(ALG_NAME) || !root.getAttributeValue("name").contains("GROBID")) {
throw new MappingException("Root name attribute is not what " +
"was expected: found "+root.getAttributeValue("name")+
", expected "+ALG_NAME);
", expected "+ALG_NAME + "or GROBID");
}
buildDoc(doc, root);

Expand Down

0 comments on commit 0f886cc

Please sign in to comment.