This repository has been archived by the owner on Apr 20, 2022. It is now read-only.
forked from kermitt2/grobid
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kermitt2#317 from csw/bibdata-quoting
Fix BibDataSetContextExtractor to quote replacement text Former-commit-id: 31936a3
- Loading branch information
Showing
3 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
grobid-core/src/test/java/org/grobid/core/utilities/BibDataSetContextExtractorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.grobid.core.utilities; | ||
|
||
import org.apache.commons.io.IOUtils; | ||
|
||
import org.junit.Test; | ||
|
||
import java.io.InputStream; | ||
import java.nio.charset.StandardCharsets; | ||
|
||
public class BibDataSetContextExtractorTest { | ||
|
||
@Test | ||
public void testRefEscapes() throws Exception { | ||
InputStream is = this.getClass().getResourceAsStream("/test/tei-escape.xml"); | ||
String tei = IOUtils.toString(is, StandardCharsets.UTF_8); | ||
is.close(); | ||
BibDataSetContextExtractor.getCitationReferences(tei); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<TEI xmlns="http://www.tei-c.org/ns/1.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 /home/lopez/grobid/grobid-home/schemas/xsd/Grobid.xsd" | ||
xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<text xml:lang="en"> | ||
<body> | ||
<div xmlns="http://www.tei-c.org/ns/1.0"><p>Lorem ipsum <ref type="bibr" target="#b0">$9,</ref><ref type="bibr" target="#b1">2]</ref>. | ||
</p></div> | ||
</body> | ||
</text> | ||
</TEI> |