node-sword-interface 1.0.96 → 1.0.97

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CMakeLists.txt CHANGED
@@ -46,6 +46,8 @@ ${CMAKE_SOURCE_DIR}/src/sword_backend/module_installer.cpp
46
46
  ${CMAKE_SOURCE_DIR}/src/sword_backend/text_processor.cpp
47
47
  ${CMAKE_SOURCE_DIR}/src/sword_backend/module_search.cpp
48
48
  ${CMAKE_SOURCE_DIR}/src/sword_backend/mutex.cpp
49
+ ${CMAKE_SOURCE_DIR}/src/sword_backend/unzip/ioapi.c
50
+ ${CMAKE_SOURCE_DIR}/src/sword_backend/unzip/unzip.c
49
51
  )
50
52
 
51
53
  add_executable(node_sword_cli ${SOURCES})
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-sword-interface",
3
- "version": "1.0.96",
3
+ "version": "1.0.97",
4
4
  "description": "Javascript (N-API) interface to SWORD library",
5
5
  "keywords": [
6
6
  "C++",
@@ -112,6 +112,20 @@ void get_module_text(TextProcessor& text_processor)
112
112
  }*/
113
113
  }
114
114
 
115
+ void get_reference_text(ModuleStore& module_store, TextProcessor& text_processor)
116
+ {
117
+ cout << "RAW Text:" << endl;
118
+ SWModule* swordModule = module_store.getLocalModule("NETnote");
119
+ swordModule->setKey("1 Tim 3:2");
120
+ string rawText = swordModule->getRawEntry();
121
+ cout << rawText << endl;
122
+
123
+ cout << "Processed Text: " << endl;
124
+ text_processor.enableMarkup();
125
+ Verse text = text_processor.getReferenceText("NETnote", "1 Tim 3:2");
126
+ cout << text.content << endl;
127
+ }
128
+
115
129
  void get_book_intro(TextProcessor& text_processor)
116
130
  {
117
131
  cout << "Text:" << endl;
@@ -229,6 +243,8 @@ int main(int argc, char** argv)
229
243
 
230
244
  //get_module_text(textProcessor);
231
245
 
246
+ get_reference_text(moduleStore, textProcessor);
247
+
232
248
  //get_book_intro(textProcessor);
233
249
 
234
250
  //get_book_list(moduleHelper);
@@ -52,6 +52,7 @@ string TextProcessor::getFilteredText(const string& text, int chapter, int verse
52
52
 
53
53
  static string lbBeginParagraph = "<lb type=\"x-begin-paragraph\"/>";
54
54
  static string lbEndParagraph = "<lb type=\"x-end-paragraph\"/>";
55
+ static string emptyParagraphElement = "<p/>";
55
56
  static string lbElementFilter = "<lb ";
56
57
  static string lElementFilter = "<l ";
57
58
  static string lgElementFilter = "<lg ";
@@ -117,6 +118,7 @@ string TextProcessor::getFilteredText(const string& text, int chapter, int verse
117
118
  this->findAndReplaceAll(filteredText, chapterFilter, "<chapter class=\"sword-markup sword-chapter\"");
118
119
  this->findAndReplaceAll(filteredText, lbBeginParagraph, "");
119
120
  this->findAndReplaceAll(filteredText, lbEndParagraph, "&nbsp;<div class=\"sword-markup sword-paragraph-end\"><br></div>");
121
+ this->findAndReplaceAll(filteredText, emptyParagraphElement, "");
120
122
  this->findAndReplaceAll(filteredText, lbElementFilter, "<div class=\"sword-markup sword-lb\" ");
121
123
  this->findAndReplaceAll(filteredText, lElementFilter, "<div class=\"sword-markup sword-l\" ");
122
124
  this->findAndReplaceAll(filteredText, lgElementFilter, "<div class=\"sword-markup sword-lg\" ");