diff --git a/UniqueBibleAppVersion.txt b/UniqueBibleAppVersion.txt index 463cee4241..29eab2b352 100755 --- a/UniqueBibleAppVersion.txt +++ b/UniqueBibleAppVersion.txt @@ -1 +1 @@ -35.28 +35.29 diff --git a/latest_changes.txt b/latest_changes.txt index 273aedc426..395efefaac 100755 --- a/latest_changes.txt +++ b/latest_changes.txt @@ -1,3 +1,6 @@ +Changes in 35.29: +* Add concordance to api server + Changes in 35.28: * Add "Install ALL" to module downloads diff --git a/patches.txt b/patches.txt index e10de85c38..3b9a8d2f40 100755 --- a/patches.txt +++ b/patches.txt @@ -1356,7 +1356,6 @@ (35.19, "file", "startup/nonGui.py") (35.19, "file", "util/ConfigUtil.py") (35.20, "file", "util/TextUtil.py") -(35.21, "file", "util/RemoteApiHandler.py") (35.22, "file", "util/RemoteCliHandler.py") (35.23, "file", "util/checkup.py") (35.24, "file", "gui/MaterialMainWindow.py") @@ -1394,6 +1393,7 @@ (35.28, "file", ".gitignore") (35.28, "file", "gui/MainWindow.py") (35.28, "file", "util/DatafileLocation.py") -(35.28, "file", "patches.txt") -(35.28, "file", "latest_changes.txt") -(35.28, "file", "UniqueBibleAppVersion.txt") +(35.29, "file", "util/RemoteApiHandler.py") +(35.29, "file", "latest_changes.txt") +(35.29, "file", "UniqueBibleAppVersion.txt") +(35.29, "file", "patches.txt") diff --git a/util/RemoteApiHandler.py b/util/RemoteApiHandler.py index eb970ced6b..2bdeaf4095 100644 --- a/util/RemoteApiHandler.py +++ b/util/RemoteApiHandler.py @@ -138,6 +138,8 @@ def processRequest(self, request): self.processCrossReferenceCommand(cmd) elif command == "search": self.processSearchCommand(cmd, query) + elif command == "concordance": + self.processConcordanceCommand(cmd, query) elif command == "morphology": self.processMorphologyCommand(cmd) elif command == "searchtool": @@ -372,6 +374,31 @@ def processSearchCommand(self, cmd, query): except Exception as ex: self.sendError("Invalid search command - " + ex) + # /concordance/KJVx/G1654 + def processConcordanceCommand(self, cmd, query): + try: + text = cmd[1] + strongs = cmd[2] + query = "SELECT Book, Chapter, Verse, Scripture FROM Verses " + query += "WHERE " + query += "(Scripture LIKE ?) " + query += "ORDER BY Book, Chapter, Verse " + query += "LIMIT 5000 " + t = ("%{0} %".format(strongs),) + verses = Bible(text).getSearchVerses(query, t) + + processed = [] + for data in verses: + verse = data[3].replace(strongs + " ", "XXXXX") + verse = re.sub(r"[HG][0-9]+? ", "", verse) + verse = re.sub(r" ([,.;:])", "\\1", verse) + verse = verse.replace("XXXXX", strongs + " ") + processed.append((data[0], data[1], data[2], verse)) + + self.jsonData['data'] = processed + except Exception as ex: + self.sendError("Invalid search command - " + ex) + # /morphology/1/34684 def processMorphologyCommand(self, cmd): if len(cmd) < 3: