Created
May 30, 2018 20:10
-
-
Save dirkgr/7031efb93463552cec26d4411e6076a2 to your computer and use it in GitHub Desktop.
Parsing just references with science-parse
This file contains hidden or 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
ExtractReferences referenceExtractor; | |
try( | |
final InputStream gazetteerIs = new FileInputStream(Parser.getDefaultGazetteer().toFile()); | |
final DataInputStream bibModelIs = new DataInputStream(new FileInputStream(Parser.getDefaultBibModel().toFile())) | |
) { | |
referenceExtractor = new ExtractReferences(gazetteerIs, bibModelIs); | |
} | |
List<String> referenceLines = Arrays.asList("Reference 1", "Reference 2", "etc."); | |
Pair<List<BibRecord>, List<CitationRecord>> allResults = | |
Parser.getReferences(Collections.emptyList(), referenceLines, referenceExtractor); | |
List<BibRecord> parsedReferences = allResults.getOne() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment