From 341ee65afbd5932b441f179ba45ec8808f49af72 Mon Sep 17 00:00:00 2001 From: Ben Linskey Date: Tue, 7 Jan 2014 17:40:17 -0500 Subject: Add Sources Cited to syntax database --- src/com/benlinskey/grdbc/SyntaxCreator.java | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src/com/benlinskey/grdbc') diff --git a/src/com/benlinskey/grdbc/SyntaxCreator.java b/src/com/benlinskey/grdbc/SyntaxCreator.java index de93d77..10637aa 100644 --- a/src/com/benlinskey/grdbc/SyntaxCreator.java +++ b/src/com/benlinskey/grdbc/SyntaxCreator.java @@ -33,8 +33,6 @@ import org.xml.sax.SAXException; /** * Reads in an XML file containing the Overview of Greek Syntax text and stores * sections of the text in an SQLite database. - *

- * Note that the Sources Cited section is omitted, as it is on Perseus. * @author Ben Linskey * */ @@ -146,6 +144,13 @@ public class SyntaxCreator { Matcher matcher = pattern.matcher(line); matcher.find(); chapter = matcher.group(1); + + if (chapter.equals("Sources Cited")) { + section = chapter; + xml.delete(0, xml.length()); + xml.append("

"); + xml.append("Sources Cited"); + } } else if (line.startsWith("") && chapter.equals("Sources Cited")) { + // Get any XML before the "" tag. + String[] split = line.split(""); + xml.append(split[0]); + + // Add closing root tag. + xml.append("
"); + + // Add data to database. + insertStatement.setString(1, chapter); + insertStatement.setString(2, section); + insertStatement.setString(3, xml.toString()); + insertStatement.addBatch(); } else { // Get next line of XML. xml.append(line); -- cgit v1.2.3