From 88be685769c643fc84cacd3692b42c9dea9e2ca6 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:05:59 -0500 Subject: [PATCH 01/28] spelling: anyway --- src/Text.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text.java b/src/Text.java index fc3da4e..ab8b8ff 100755 --- a/src/Text.java +++ b/src/Text.java @@ -310,7 +310,7 @@ protected static int insertValues(Connection c, String title,int textDepth, int //theText = convertToJH8(theText);////CONVERT FROM UTF8!!!!!!! //convertFromJH8(theText); - }catch(Exception e){ //if there was a problem getting the text, then it probably wasn't text anyways so just leave the function. + }catch(Exception e){ //if there was a problem getting the text, then it probably wasn't text anyway so just leave the function. System.err.println("Error: " + e); System.err.println("sql_adding_text: Problem adding text " + title + " it[1] = " + it[1]); textsFailedToUpload++; From 4c56163f97b9852874cfcd9eb4b98ae92663ee7e Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:06:49 -0500 Subject: [PATCH 02/28] spelling: beginning --- src/CSVReader.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CSVReader.java b/src/CSVReader.java index 94c37a5..30a6e71 100755 --- a/src/CSVReader.java +++ b/src/CSVReader.java @@ -149,8 +149,8 @@ private String[] parseLine(String nextLine) throws IOException { }else{ inQuotes = !inQuotes; // the tricky case of an embedded quote in the middle: a,bc"d"ef,g - if(i>2 //not on the begining of the line - && nextLine.charAt(i-1) != this.separator //not at the begining of an escape sequence + if(i>2 //not on the beginning of the line + && nextLine.charAt(i-1) != this.separator //not at the beginning of an escape sequence && nextLine.length()>(i+1) && nextLine.charAt(i+1) != this.separator //not at the end of an escape sequence ){ From f112e898c50f0c81b23967bfd6587234f3a315ca Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:08:28 -0500 Subject: [PATCH 03/28] spelling: careful --- scripts/headers/createHeaders.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/headers/createHeaders.py b/scripts/headers/createHeaders.py index 44ba084..01b3a9a 100755 --- a/scripts/headers/createHeaders.py +++ b/scripts/headers/createHeaders.py @@ -56,7 +56,7 @@ def int2heb(num): heb = "" + hChar1 + heb; place+=1; #now search for 15 & 16 to replace - ka = "é" + "ä"; #carefull...don't join these strings + ka = "é" + "ä"; #careful...don't join these strings ku = "é" + "å"; heb = heb.replace(ka,"èå"); heb = heb.replace(ku,"èæ"); @@ -214,4 +214,4 @@ def main(): addHeaders("Yismach Yisrael" + " on Pesach Haggadah",3, hagadahSectionsEn, hagadahSectionsHe, 0, 0) if __name__ == "__main__": - main() \ No newline at end of file + main() From dc3e98aa8f4a9f6423a97425e2197d94e8960393 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:09:52 -0500 Subject: [PATCH 04/28] spelling: commentary --- preDatabaseUpload.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/preDatabaseUpload.py b/preDatabaseUpload.py index a38d710..f5ab1ac 100755 --- a/preDatabaseUpload.py +++ b/preDatabaseUpload.py @@ -141,9 +141,9 @@ def reorderFiles(unordered): '^Mishnah/Seder ', '^Talmud/Bavli/Seder ', '^Talmud/Yerushalmi/Seder ', '^Tanakh/Commentary/Rashi', '^Tanakh/Targum/Onkelos', '^Tanakh/Commentary/Ibn Ezra', '^Tanakh/Commentary/Ramban', '^Tanakh/Commentary/Sforno', '^Tanakh/Commentary/Rashbam', - '^Tanakh/Commentary', '^Tanakh/Commentary/', '^Other/Commentary2/Tanakh/', '^Tanakh/Targum/', # make sure that the rest of the Tanakh commentaries come b/f any other category commenary + '^Tanakh/Commentary', '^Tanakh/Commentary/', '^Other/Commentary2/Tanakh/', '^Tanakh/Targum/', # make sure that the rest of the Tanakh commentaries come b/f any other category commentary - '^Mishnah/Commentary/Bartenura', '^Mishnah/Commentary/Ikar Tosafot Yom Tov', '/Mishnah/Tosafot Yom Tov', '^Mishnah/Commentary/', '^Other/Commentary2/Mishnah/', # make sure that the rest of the mishna commentaries come b/f any other category commenary + '^Mishnah/Commentary/Bartenura', '^Mishnah/Commentary/Ikar Tosafot Yom Tov', '/Mishnah/Tosafot Yom Tov', '^Mishnah/Commentary/', '^Other/Commentary2/Mishnah/', # make sure that the rest of the mishna commentaries come b/f any other category commentary '^Talmud/Commentary/Rashi', '^Talmud/Commentary/Tosafot', '/Talmud/Rashba', '^Talmud/Rif/', '^Talmud/Commentary/', '^Other/Commentary2/Talmud/', From e368d543e6695e57d4c8744eebd7de525e576497 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:10:00 -0500 Subject: [PATCH 05/28] spelling: connection --- preDatabaseUpload.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/preDatabaseUpload.py b/preDatabaseUpload.py index f5ab1ac..6cceeda 100755 --- a/preDatabaseUpload.py +++ b/preDatabaseUpload.py @@ -50,7 +50,7 @@ def links(): thisLine += convert2Levels(row[0].replace(row[3] + " " ,"").split(':'), row[5], row[0]) thisLine += [row[4]] thisLine += convert2Levels(row[1].replace(row[4] + " " ,"").split(':'), row[6], row[1]) - thisLine += [conncetionType(row[2])] + thisLine += [connectionType(row[2])] writer.writerow(thisLine) numberOfLines += 1 in_file_number += 1 @@ -81,7 +81,7 @@ def daf2Num(daf): return value; -def conncetionType(connString): +def connectionType(connString): return connString[0:3].lower() #map = {'quotation': 1, 'commentary':2, 'reference':3,'related':4,'midrash':5, 'allusion':6, 'mesorat hashas': 7, 'summary':8, 'Law':9,'ein mishpat':10,'Liturgy':11,'explication':12, 'targum':13,'Ellucidation':14}; #if connString not in map.keys(): From 7008165ad2692c8faad910efd0d8e65239c41b9f Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:10:07 -0500 Subject: [PATCH 06/28] spelling: consistent --- src/Link.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Link.java b/src/Link.java index d775fc8..3f8fc2e 100755 --- a/src/Link.java +++ b/src/Link.java @@ -191,7 +191,7 @@ static void addLinkFile(Connection c, CSVReader reader){ } /** - * repositions the row so that it will be consistant (ignoring textdepth) when trying to get the values at each level. + * repositions the row so that it will be consistent (ignoring textdepth) when trying to get the values at each level. * @param row * @param bida * @param textDeptha From abc2261e1719c328ffa403b9e196e33965fc5372 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:10:13 -0500 Subject: [PATCH 07/28] spelling: conversion --- src/Book.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Book.java b/src/Book.java index caa750e..8e65e11 100755 --- a/src/Book.java +++ b/src/Book.java @@ -229,7 +229,7 @@ public static void addBook(Connection c, JSONObject enJSON, JSONObject heJSON, b } textDepth = str2strArray(sectionNames).length; if(str2strArray(heSectionNames).length != textDepth){ - System.err.println("section names convertion problem:" + heSectionNames); + System.err.println("section names conversion problem:" + heSectionNames); System.exit(-1); } From 9a1f3eb51bf3d35901d0cf5de4150bf58630492a Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:10:37 -0500 Subject: [PATCH 08/28] spelling: converted --- src/org/json/JSONArray.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/json/JSONArray.java b/src/org/json/JSONArray.java index 3f05548..ba56bd9 100755 --- a/src/org/json/JSONArray.java +++ b/src/org/json/JSONArray.java @@ -547,7 +547,7 @@ public long optLong(int index, long defaultValue) { /** * Get the optional string value associated with an index. It returns an * empty string if there is no value at that index. If the value is not a - * string and is not null, then it is coverted to a string. + * string and is not null, then it is converted to a string. * * @param index * The index must be between 0 and length() - 1. From aa584c8139289f334581fd979b1a185ad80fe958 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:10:28 -0500 Subject: [PATCH 09/28] spelling: count --- src/Searching.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Searching.java b/src/Searching.java index a700f49..7ccfc0e 100755 --- a/src/Searching.java +++ b/src/Searching.java @@ -222,7 +222,7 @@ private static byte[] toJHpackets(BitSet bits) { ArrayList blob = new ArrayList(); int packetCount = bits.length()/BITS_PER_PACKET + 1; if(packetCount > 255){ - System.err.println("TO BIG PACKET COUNT... MUST CHANGE TO 8 BYTE packets...packetCouunt: " + packetCount); + System.err.println("TO BIG PACKET COUNT... MUST CHANGE TO 8 BYTE packets...packetCount: " + packetCount); System.exit(-1); } @@ -240,7 +240,7 @@ private static byte[] toJHpackets(BitSet bits) { packBits.set(j); } }catch(Exception e){ - System.err.println("bitnum: " + bitNum + ".. bits.length:" + bits.length() + " (i,j): " + i + "," + j + "...packetCouunt: " + packetCount); + System.err.println("bitnum: " + bitNum + ".. bits.length:" + bits.length() + " (i,j): " + i + "," + j + "...packetCount: " + packetCount); break; } } From 99c3337d68a4107a0f4f7b3a1820e7e5941b81c9 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:10:51 -0500 Subject: [PATCH 10/28] spelling: deflated --- src/Huffman.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Huffman.java b/src/Huffman.java index fd65b75..6479bc3 100755 --- a/src/Huffman.java +++ b/src/Huffman.java @@ -512,14 +512,14 @@ public static void test(){ makeTree(); List encodedText = encode(text); System.out.println(decode(encodedText)); - String defalted = getDeflatedTree(); - System.out.println(defalted); - huffmanRoot = enflateTree(defalted); + String deflated = getDeflatedTree(); + System.out.println(deflated); + huffmanRoot = enflateTree(deflated); //printTree(huffmanRoot, ""); if(!text.equals(decode(encodedText))) - System.err.println("problem with defalted thing"); + System.err.println("problem with deflated thing"); else{ System.out.println("\nGood Work!!\n" + decode(encodedText)); } From 8d6fe9f45eff1eeb2387dfa29fa91e866c09cf3f Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:12:40 -0500 Subject: [PATCH 11/28] spelling: headers (API) --- src/Header.java | 2 +- src/Huffman.java | 2 +- src/SQLite.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Header.java b/src/Header.java index 0f5e27b..0993893 100755 --- a/src/Header.java +++ b/src/Header.java @@ -13,7 +13,7 @@ public class Header extends SQLite { static int headersFailed = 0; - public static final String CREATE_HEADES_TABLE = "CREATE TABLE " + TABLE_HEADERS + "(\r\n" + + public static final String CREATE_HEADERS_TABLE = "CREATE TABLE " + TABLE_HEADERS + "(\r\n" + " _id INTEGER PRIMARY KEY,\r\n" + " bid INTEGER,\r\n" + " heHeader TEXT,\r\n" + diff --git a/src/Huffman.java b/src/Huffman.java index 6479bc3..38bcdc8 100755 --- a/src/Huffman.java +++ b/src/Huffman.java @@ -337,7 +337,7 @@ public static void copyNewDB(String oldDB, String newDB, Searching.SEARCH_METHOD /* * copyTable(c, "Texts", Text.CREATE_TEXTS_TABLE, newDB); - * copyTable(c, "Headers", Header.CREATE_HEADES_TABLE, newDB); + * copyTable(c, "Headers", Header.CREATE_HEADERS_TABLE, newDB); * copyTable(c, "Links", Link.CREATE_TABLE_LINKS, newDB); */ copyTable(c, "android_metadata", CREATE_TABLE_METADATA, newDB); diff --git a/src/SQLite.java b/src/SQLite.java index aff57d3..7dad563 100755 --- a/src/SQLite.java +++ b/src/SQLite.java @@ -158,7 +158,7 @@ public static void createTables(){ stmt.executeUpdate(Node.CREATE_NODE_TABLE); stmt.executeUpdate(Searching.CREATE_SEARCH); stmt.executeUpdate(Book.CREATE_BOOKS_TABLE); - stmt.executeUpdate(Header.CREATE_HEADES_TABLE); + stmt.executeUpdate(Header.CREATE_HEADERS_TABLE); stmt.executeUpdate(CREATE_TABLE_SETTINGS); From 69b06a3ea38d669c788d7b8aa103afb123ea8959 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:14:38 -0500 Subject: [PATCH 12/28] spelling: indentation --- src/org/json/JSONArray.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/json/JSONArray.java b/src/org/json/JSONArray.java index ba56bd9..7d11619 100755 --- a/src/org/json/JSONArray.java +++ b/src/org/json/JSONArray.java @@ -934,7 +934,7 @@ public Writer write(Writer writer) throws JSONException { * @param indentFactor * The number of spaces to add to each level of indentation. * @param indent - * The indention of the top level. + * The indentation of the top level. * @return The writer. * @throws JSONException */ From 2ad5151858f2ce94aa14da7deae56ea48577cdb5 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:11:28 -0500 Subject: [PATCH 13/28] spelling: inflate --- src/Huffman.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Huffman.java b/src/Huffman.java index 38bcdc8..368104c 100755 --- a/src/Huffman.java +++ b/src/Huffman.java @@ -109,7 +109,7 @@ public static void addAllTexts(Connection c){ String deflated = Huffman.getDeflatedTree(); System.out.println((new Date()).getTime() + "finished deflating"); System.out.println("deflated size:"+ Huffman.utf8Length(deflated)); - huffmanRoot = Huffman.enflateTree(deflated); + huffmanRoot = Huffman.inflateTree(deflated); System.out.println((new Date()).getTime() + "finished enflating"); if(testStr.equals(decode(compressedTest))){ System.out.println("Good: decoding"); @@ -514,7 +514,7 @@ public static void test(){ System.out.println(decode(encodedText)); String deflated = getDeflatedTree(); System.out.println(deflated); - huffmanRoot = enflateTree(deflated); + huffmanRoot = inflateTree(deflated); //printTree(huffmanRoot, ""); @@ -556,7 +556,7 @@ else if(node.leftChild.plainText == null && cameFrom != node.leftChild){ } } - public static Huffman enflateTree(String deflated){ + public static Huffman inflateTree(String deflated){ Date date = new Date(); long startTime = date.getTime(); Huffman root = new Huffman(); From 3ca9cbbcd578830dd6cb6176dcc2cfe1bae56555 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:11:37 -0500 Subject: [PATCH 14/28] spelling: inflating --- src/Huffman.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Huffman.java b/src/Huffman.java index 368104c..02f0b2f 100755 --- a/src/Huffman.java +++ b/src/Huffman.java @@ -110,7 +110,7 @@ public static void addAllTexts(Connection c){ System.out.println((new Date()).getTime() + "finished deflating"); System.out.println("deflated size:"+ Huffman.utf8Length(deflated)); huffmanRoot = Huffman.inflateTree(deflated); - System.out.println((new Date()).getTime() + "finished enflating"); + System.out.println((new Date()).getTime() + "finished inflating"); if(testStr.equals(decode(compressedTest))){ System.out.println("Good: decoding"); }else From 1991dd5f9903777a1618ba420acff1198d7de5a1 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:11:42 -0500 Subject: [PATCH 15/28] spelling: inflation --- src/Huffman.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Huffman.java b/src/Huffman.java index 02f0b2f..49cc70d 100755 --- a/src/Huffman.java +++ b/src/Huffman.java @@ -594,7 +594,7 @@ public static Huffman inflateTree(String deflated){ node = tempNode; } } - System.out.println("enflation took:" + ((new Date()).getTime() - startTime)/1000.0); + System.out.println("inflation took:" + ((new Date()).getTime() - startTime)/1000.0); return root; } From 720f1a7e10f9c43e11d7007e148573f2cb4d3c74 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:14:46 -0500 Subject: [PATCH 16/28] spelling: inputting --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3302854..375e33b 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Converts [Sefaria-Export](https://github.com/Sefaria/Sefaria-Export) to SQLite d The java code is in src/ -SQLite.java is the highest level code (it run at startup). Book.java contains methods for inputing the data about each book into the database. Simularly, Header, Link, Searching, and Text are responsible for putting their respective items into the database (in their own table). Node.java is responsible for putting in Nodes for complex texts and/or alternate structures. +SQLite.java is the highest level code (it run at startup). Book.java contains methods for inputting the data about each book into the database. Simularly, Header, Link, Searching, and Text are responsible for putting their respective items into the database (in their own table). Node.java is responsible for putting in Nodes for complex texts and/or alternate structures. There are some preprocessing python srcipts in scripts/ From c3f131908ee6cbf61fdf2d43c7f8f11d8d4197a4 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:17:20 -0500 Subject: [PATCH 17/28] spelling: performing --- src/Link.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Link.java b/src/Link.java index 3f8fc2e..2c8aceb 100755 --- a/src/Link.java +++ b/src/Link.java @@ -207,7 +207,7 @@ static void addLinkFile(Connection c, CSVReader reader){ row[i - 1] = row[i]; } row[startingNum] = "0"; - //Log.d("sql_link_values", "preforming fix row[x] A-" + booka.title + " " + whileLoopC++); + //Log.d("sql_link_values", "performing fix row[x] A-" + booka.title + " " + whileLoopC++); } startingNum = 13; @@ -217,7 +217,7 @@ static void addLinkFile(Connection c, CSVReader reader){ row[i - 1] = row[i]; } row[startingNum] = "0"; - //Log.d("sql_link_values", "preforming fix row[x] B-" + bookb.title+ " " + whileLoopC++ ); + //Log.d("sql_link_values", "performing fix row[x] B-" + bookb.title+ " " + whileLoopC++ ); } return row; } From 50218c4e9816f940af85d38b9ab97840cc7ea88d Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:17:31 -0500 Subject: [PATCH 18/28] spelling: python --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 375e33b..6cbffc1 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ Converts [Sefaria-Export](https://github.com/Sefaria/Sefaria-Export) to SQLite d ## How to use 1. git clone https://github.com/Sefaria/Sefaria-SQL.git 2. git clone https://github.com/Sefaria/Sefaria-Export.git (into the same dir that Sefaria-SQL is in) -3. Go to scripts/links and run: pytyhon2 createLinks.py -4. Go to scripts/fileList and run: pytyhon2 createFileList.py -5. (Not really needed b/c headers are part of clone) go to Sefaria-SQL/scripts/headers and run: pytyhon2 createHeaders.py +3. Go to scripts/links and run: python2 createLinks.py +4. Go to scripts/fileList and run: python2 createFileList.py +5. (Not really needed b/c headers are part of clone) go to Sefaria-SQL/scripts/headers and run: python2 createHeaders.py 6. Open Sefaria-SQL in [Eclipse](http://www.eclipse.org/downloads/) for Java (File -> import -> Existing Projects into Workspace) 7. In src/SQLite.java, you can change variables 8. Run project From 8a79e8a5103744acd1cd26014cf28dc4cc938574 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:17:53 -0500 Subject: [PATCH 19/28] spelling: references --- src/Node.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Node.java b/src/Node.java index 5ce9de2..8ee1217 100755 --- a/src/Node.java +++ b/src/Node.java @@ -55,9 +55,9 @@ public class Node extends SQLite{ " structNum INTEGER NOT NULL default 1,\r\n" + " textDepth INTEGER,\r\n" + - " startTid INTEGER,\r\n" + //maybe only used with refferences on alt structure - " endTid INTEGER,\r\n" + //maybe only used with refferences on alt structure - " extraTids TEXT,\r\n" + //maybe only used with refferences on alt structure ex. "[34-70,98-200]" + " startTid INTEGER,\r\n" + //maybe only used with references on alt structure + " endTid INTEGER,\r\n" + //maybe only used with references on alt structure + " extraTids TEXT,\r\n" + //maybe only used with references on alt structure ex. "[34-70,98-200]" " startLevels TEXT,\r\n" + // " key TEXT,\r\n" + // //maybe some stuff like to display chap name and or number (ei. maybe add some displaying info) From 200531de7f148b0495d52ec3817d13a468d573cf Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:19:21 -0500 Subject: [PATCH 20/28] spelling: scripts --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6cbffc1..32e9f02 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ The java code is in src/ SQLite.java is the highest level code (it run at startup). Book.java contains methods for inputting the data about each book into the database. Simularly, Header, Link, Searching, and Text are responsible for putting their respective items into the database (in their own table). Node.java is responsible for putting in Nodes for complex texts and/or alternate structures. -There are some preprocessing python srcipts in scripts/ +There are some preprocessing python scripts in scripts/ scripts/fileList/createFileList.py creates a list of files to be upload based on the index and exported files. From 814198fa36d1ee4b13e8276b86171e0b48b694bc Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:18:20 -0500 Subject: [PATCH 21/28] spelling: separated --- preDatabaseUpload.py | 2 +- src/Text.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/preDatabaseUpload.py b/preDatabaseUpload.py index 6cceeda..1dedca7 100755 --- a/preDatabaseUpload.py +++ b/preDatabaseUpload.py @@ -134,7 +134,7 @@ def createFileList(): def reorderFiles(unordered): - #note: this only works for the list of Commentaries that serperated from the rest of the list. + #note: this only works for the list of Commentaries that separated from the rest of the list. # so it doesn't include Other/Commentary2 specials = [ '^Tanakh/Torah/','^Tanakh/Prophets/', '^Tanakh/Writings/', diff --git a/src/Text.java b/src/Text.java index ab8b8ff..5f1a5e4 100755 --- a/src/Text.java +++ b/src/Text.java @@ -317,7 +317,7 @@ protected static int insertValues(Connection c, String title,int textDepth, int return -1; } - //Huffman.addTextCount(theText);//commented out in order to make the copying a seperated task + //Huffman.addTextCount(theText);//commented out in order to make the copying a separated task PreparedStatement stmt = null; try{ stmt = c.prepareStatement("INSERT INTO Texts (" From 5363634d37c390eb40a286a79be9e0377116cc63 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:19:00 -0500 Subject: [PATCH 22/28] spelling: should --- src/Link.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Link.java b/src/Link.java index 2c8aceb..d5abc54 100755 --- a/src/Link.java +++ b/src/Link.java @@ -223,7 +223,7 @@ static void addLinkFile(Connection c, CSVReader reader){ } private static PreparedStatement putValues(PreparedStatement stmt, String [] row, int bida, int bidb, boolean addConnType) throws NumberFormatException, SQLException{ - //row shuold already be repositioned + //row should already be repositioned stmt.setInt(1, bida); stmt.setInt(2, catchDafs(row[6])); From dc6610d47b8e5e0d52f36e5215e4a27f75aab283 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:19:11 -0500 Subject: [PATCH 23/28] spelling: similarly --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 32e9f02..682ff56 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Converts [Sefaria-Export](https://github.com/Sefaria/Sefaria-Export) to SQLite d The java code is in src/ -SQLite.java is the highest level code (it run at startup). Book.java contains methods for inputting the data about each book into the database. Simularly, Header, Link, Searching, and Text are responsible for putting their respective items into the database (in their own table). Node.java is responsible for putting in Nodes for complex texts and/or alternate structures. +SQLite.java is the highest level code (it run at startup). Book.java contains methods for inputting the data about each book into the database. Similarly, Header, Link, Searching, and Text are responsible for putting their respective items into the database (in their own table). Node.java is responsible for putting in Nodes for complex texts and/or alternate structures. There are some preprocessing python scripts in scripts/ From 8e2d74ad7129daa528c99bb2bc44c4bdef8872a7 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:19:37 -0500 Subject: [PATCH 24/28] spelling: struct --- src/Node.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Node.java b/src/Node.java index 8ee1217..7c1f677 100755 --- a/src/Node.java +++ b/src/Node.java @@ -763,7 +763,7 @@ protected static int addWholeSchemas(Connection c, JSONObject schemas) throws JS try{ JSONObject alts = schemas.getJSONObject("alts"); String bookTitle = schemas.getString("title"); - String default_struct = "__UNUSED__"; //didn't leave it blank in case 2 sturcts both have no name and I push them together. + String default_struct = "__UNUSED__"; //didn't leave it blank in case 2 structs both have no name and I push them together. try{ default_struct = schemas.getString("default_struct"); }catch(Exception e){ From 82258913decdd6fcf18cc5b246c31a5603d8ee22 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:19:29 -0500 Subject: [PATCH 25/28] spelling: structure --- src/Link.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Link.java b/src/Link.java index d5abc54..ec78e1f 100755 --- a/src/Link.java +++ b/src/Link.java @@ -69,7 +69,7 @@ static String getTitleFromComplex(String fullPath){ } public static Node.NodePair getParentID(String title, String fullPath, int bid){ - if(title.equals(fullPath)){ //it's referencing the book directly... A good example of this is when there's a default structre that it's referencing (or anything without subnodes) + if(title.equals(fullPath)){ //it's referencing the book directly... A good example of this is when there's a default structure that it's referencing (or anything without subnodes) Node.NodePair nodePair = null; if(booksIsComplex.get(bid)){ nodePair = allDefaultNodesByBID.get(bid); From afff672947cc0c4ca589e2f181e618e73ebbd55f Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:19:56 -0500 Subject: [PATCH 26/28] spelling: text --- src/Searching.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Searching.java b/src/Searching.java index 7ccfc0e..f381fcb 100755 --- a/src/Searching.java +++ b/src/Searching.java @@ -90,7 +90,7 @@ public static void makeFreshIndex(Connection newDBConnection, String oldDB, SEAR private static String [] getWords(String text){ - //String orgTetx = ""+ text; + //String orgText = ""+ text; text = text.replaceAll("[\u05be]", " "); text = text.replaceAll("[\u0591-\u05C7\u05f3\u05f4\'\"]", ""); text = text.replaceAll("([^\u05d0-\u05ea])", " "); From 492513e6471c2b24bff287e202b0e95c7c76c3ef Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:20:28 -0500 Subject: [PATCH 27/28] spelling: unrecognized --- src/SQLite.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SQLite.java b/src/SQLite.java index 7dad563..42ecc79 100755 --- a/src/SQLite.java +++ b/src/SQLite.java @@ -407,7 +407,7 @@ static int returnLangNums(String langString){ return LANG_EN; else if(langString.equals("he")) return LANG_HE; - System.err.println("unrecignized lang:" + langString); + System.err.println("unrecognized lang:" + langString); return 0; } From 52cdbde7f97d2660e87d4f8b01a4a2a090569c0a Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 27 Jan 2019 12:20:40 -0500 Subject: [PATCH 28/28] spelling: version --- src/Huffman.java | 6 +++--- src/SQLite.java | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Huffman.java b/src/Huffman.java index 49cc70d..5367ed2 100755 --- a/src/Huffman.java +++ b/src/Huffman.java @@ -345,7 +345,7 @@ public static void copyNewDB(String oldDB, String newDB, Searching.SEARCH_METHOD //copyTable(c, "Searching", Searching.CREATE_SEARCH, newDB); Searching.makeSearching(searchMethod, c, oldDB, newDB); - setSettings("version", DB_VERION_NUM +"", c); + setSettings("version", DB_VERSION_NUM +"", c); copyTextTable(c, oldDB); c.close(); @@ -378,7 +378,7 @@ public static void copyNewHeTextOnlyDB(String oldDB, String newDB, Searching.SEA c.prepareStatement("INSERT INTO heTexts (" + columns + ") SELECT " + "heTextCompress" + " FROM oldDB.Texts").execute(); Searching.makeSearching(searchMethod, c, oldDB, newDB); - setSettings("version", DB_VERION_NUM +"", c); + setSettings("version", DB_VERSION_NUM +"", c); c.close(); @@ -402,7 +402,7 @@ public static void copyNewAPIDB(String oldDB, String newDB){ copyTable(c, "android_metadata", CREATE_TABLE_METADATA, newDB); setSettings("api", ""+1, c); - setSettings("version", DB_VERION_NUM +"", c); + setSettings("version", DB_VERSION_NUM +"", c); c.close(); } catch (SQLException e) { e.printStackTrace(); diff --git a/src/SQLite.java b/src/SQLite.java index 42ecc79..f37d691 100755 --- a/src/SQLite.java +++ b/src/SQLite.java @@ -23,11 +23,11 @@ public class SQLite { - protected static final int DB_VERION_NUM = 277; - public static final String DB_NAME_PART = "test" + DB_VERION_NUM; + protected static final int DB_VERSION_NUM = 277; + public static final String DB_NAME_PART = "test" + DB_VERSION_NUM; public static final String DB_NAME_FULL = "testDBs/" + DB_NAME_PART + ".db"; public static final String DB_NAME_COPY = "testDBs/UpdateForSefariaMobileDatabase.db";//copy_" + DB_NAME_PART + ".db"; - public static final String DB_NAME_HE_ONLY_COPY = "testDBs/heTexts_" + DB_VERION_NUM + ".db"; + public static final String DB_NAME_HE_ONLY_COPY = "testDBs/heTexts_" + DB_VERSION_NUM + ".db"; public static final String DB_NAME_API = "testDBs/API_UpdateForSefariaMobileDatabase.db"; private static final int OLD_DB_NUM_TO_COPY_FROM = 265; @@ -169,7 +169,7 @@ public static void createTables(){ stmt.executeUpdate(" INSERT INTO \"android_metadata\" VALUES ('en_US')"); stmt.close(); - setSettings("version", ""+DB_VERION_NUM, c); + setSettings("version", ""+DB_VERSION_NUM, c); setSettings("api", ""+0, c); System.out.println("Created tables"); } catch ( Exception e ) {