node-sword-interface 1.0.31 → 1.0.33
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/API.md +7 -0
- package/examples/install_kjv.js +1 -1
- package/examples/print_kjv_matthew.js +1 -1
- package/index.js +8 -1
- package/package.json +2 -2
- package/scripts/build_sword.sh +1 -1
- package/scripts/get_sword_build_win32.ps1 +1 -1
- package/scripts/get_sword_include_path.sh +1 -1
- package/scripts/get_sword_library.sh +1 -1
- package/scripts/postinstall.js +1 -1
- package/src/napi_module/api_lock.cpp +1 -1
- package/src/napi_module/api_lock.hpp +1 -1
- package/src/napi_module/binding.cpp +1 -1
- package/src/napi_module/install_module_worker.cpp +1 -1
- package/src/napi_module/install_module_worker.hpp +1 -1
- package/src/napi_module/module_search_worker.cpp +1 -1
- package/src/napi_module/module_search_worker.hpp +1 -1
- package/src/napi_module/napi_sword_helper.cpp +1 -1
- package/src/napi_module/napi_sword_helper.hpp +1 -1
- package/src/napi_module/node_sword_interface.cpp +12 -1
- package/src/napi_module/node_sword_interface.hpp +2 -1
- package/src/napi_module/worker.hpp +1 -1
- package/src/sword_backend/common_defs.hpp +1 -1
- package/src/sword_backend/dict_helper.cpp +1 -1
- package/src/sword_backend/dict_helper.hpp +1 -1
- package/src/sword_backend/file_system_helper.cpp +1 -1
- package/src/sword_backend/file_system_helper.hpp +1 -1
- package/src/sword_backend/module_helper.cpp +1 -1
- package/src/sword_backend/module_helper.hpp +1 -1
- package/src/sword_backend/module_installer.cpp +1 -1
- package/src/sword_backend/module_installer.hpp +1 -1
- package/src/sword_backend/module_search.cpp +23 -8
- package/src/sword_backend/module_search.hpp +1 -1
- package/src/sword_backend/module_store.cpp +1 -1
- package/src/sword_backend/module_store.hpp +1 -1
- package/src/sword_backend/mutex.cpp +1 -1
- package/src/sword_backend/mutex.hpp +1 -1
- package/src/sword_backend/percentage_calc.hpp +1 -1
- package/src/sword_backend/repository_interface.cpp +1 -1
- package/src/sword_backend/repository_interface.hpp +1 -1
- package/src/sword_backend/string_helper.cpp +1 -1
- package/src/sword_backend/string_helper.hpp +1 -1
- package/src/sword_backend/strongs_entry.cpp +1 -1
- package/src/sword_backend/strongs_entry.hpp +1 -1
- package/src/sword_backend/sword_status_reporter.cpp +1 -1
- package/src/sword_backend/sword_status_reporter.hpp +1 -1
- package/src/sword_backend/sword_translation_helper.hpp +1 -1
- package/src/sword_backend/text_processor.cpp +37 -3
- package/src/sword_backend/text_processor.hpp +6 -1
package/API.md
CHANGED
|
@@ -50,6 +50,7 @@ This is the main class of node-sword-interface and it provides a set of static f
|
|
|
50
50
|
* [.isModuleReadable(moduleCode)](#NodeSwordInterface+isModuleReadable) ⇒ <code>Boolean</code>
|
|
51
51
|
* [.getModuleDescription(moduleCode)](#NodeSwordInterface+getModuleDescription) ⇒ <code>String</code>
|
|
52
52
|
* [.enableMarkup()](#NodeSwordInterface+enableMarkup)
|
|
53
|
+
* [.enableStrongsWithNbsp()](#NodeSwordInterface+enableStrongsWithNbsp)
|
|
53
54
|
* [.getRawModuleEntry(moduleCode, key)](#NodeSwordInterface+getRawModuleEntry) ⇒ <code>String</code>
|
|
54
55
|
* [.getReferenceText(moduleCode, key)](#NodeSwordInterface+getReferenceText) ⇒ [<code>VerseObject</code>](#VerseObject)
|
|
55
56
|
* [.getChapterText(moduleCode, bookCode, chapter)](#NodeSwordInterface+getChapterText) ⇒ [<code>Array.<VerseObject></code>](#VerseObject)
|
|
@@ -310,6 +311,12 @@ Returns the description of a module.
|
|
|
310
311
|
Enables available markup (like Strongs, foot notes, etc.)
|
|
311
312
|
This influences the output for getChapterText, getBookText and getBibleText.
|
|
312
313
|
|
|
314
|
+
**Kind**: instance method of [<code>NodeSwordInterface</code>](#NodeSwordInterface)
|
|
315
|
+
<a name="NodeSwordInterface+enableStrongsWithNbsp"></a>
|
|
316
|
+
|
|
317
|
+
### nodeSwordInterface.enableStrongsWithNbsp()
|
|
318
|
+
Enables rendering of Strongs elements with non-breaking spaces.
|
|
319
|
+
|
|
313
320
|
**Kind**: instance method of [<code>NodeSwordInterface</code>](#NodeSwordInterface)
|
|
314
321
|
<a name="NodeSwordInterface+getRawModuleEntry"></a>
|
|
315
322
|
|
package/examples/install_kjv.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -331,6 +331,13 @@ class NodeSwordInterface {
|
|
|
331
331
|
return this.nativeInterface.enableMarkup();
|
|
332
332
|
}
|
|
333
333
|
|
|
334
|
+
/**
|
|
335
|
+
* Enables rendering of Strongs elements with non-breaking spaces.
|
|
336
|
+
*/
|
|
337
|
+
enableStrongsWithNbsp() {
|
|
338
|
+
return this.nativeInterface.enableStrongsWithNbsp();
|
|
339
|
+
}
|
|
340
|
+
|
|
334
341
|
/**
|
|
335
342
|
* Returns the raw text of an entry for the given module and key.
|
|
336
343
|
* If no entry exists for the given key the return value is undefined.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-sword-interface",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.33",
|
|
4
4
|
"description": "Javascript (N-API) interface to SWORD library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"C++",
|
|
@@ -32,6 +32,6 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"jsdoc-to-markdown": "^8.0.3",
|
|
35
|
-
"node-gyp": "^
|
|
35
|
+
"node-gyp": "^9.1.0"
|
|
36
36
|
}
|
|
37
37
|
}
|
package/scripts/build_sword.sh
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# This file is part of node-sword-interface.
|
|
4
4
|
#
|
|
5
|
-
# Copyright (C) 2019 -
|
|
5
|
+
# Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
6
6
|
#
|
|
7
7
|
# node-sword-interface is free software: you can redistribute it and/or modify
|
|
8
8
|
# it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This file is part of node-sword-interface.
|
|
2
2
|
#
|
|
3
|
-
# Copyright (C) 2019 -
|
|
3
|
+
# Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
#
|
|
5
5
|
# node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
# it under the terms of the GNU General Public License as published by
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# This file is part of node-sword-interface.
|
|
4
4
|
#
|
|
5
|
-
# Copyright (C) 2019 -
|
|
5
|
+
# Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
6
6
|
#
|
|
7
7
|
# node-sword-interface is free software: you can redistribute it and/or modify
|
|
8
8
|
# it under the terms of the GNU General Public License as published by
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# This file is part of node-sword-interface.
|
|
4
4
|
#
|
|
5
|
-
# Copyright (C) 2019 -
|
|
5
|
+
# Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
6
6
|
#
|
|
7
7
|
# node-sword-interface is free software: you can redistribute it and/or modify
|
|
8
8
|
# it under the terms of the GNU General Public License as published by
|
package/scripts/postinstall.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -90,6 +90,7 @@ Napi::Object NodeSwordInterface::Init(Napi::Env env, Napi::Object exports)
|
|
|
90
90
|
InstanceMethod("getModuleDescription", &NodeSwordInterface::getModuleDescription),
|
|
91
91
|
InstanceMethod("getLocalModule", &NodeSwordInterface::getLocalModule),
|
|
92
92
|
InstanceMethod("enableMarkup", &NodeSwordInterface::enableMarkup),
|
|
93
|
+
InstanceMethod("enableStrongsWithNbsp", &NodeSwordInterface::enableStrongsWithNbsp),
|
|
93
94
|
InstanceMethod("getRawModuleEntry", &NodeSwordInterface::getRawModuleEntry),
|
|
94
95
|
InstanceMethod("getReferenceText", &NodeSwordInterface::getReferenceText),
|
|
95
96
|
InstanceMethod("getChapterText", &NodeSwordInterface::getChapterText),
|
|
@@ -526,6 +527,16 @@ Napi::Value NodeSwordInterface::enableMarkup(const Napi::CallbackInfo& info)
|
|
|
526
527
|
return info.Env().Undefined();
|
|
527
528
|
}
|
|
528
529
|
|
|
530
|
+
Napi::Value NodeSwordInterface::enableStrongsWithNbsp(const Napi::CallbackInfo& info)
|
|
531
|
+
{
|
|
532
|
+
lockApi();
|
|
533
|
+
Napi::Env env = info.Env();
|
|
534
|
+
Napi::HandleScope scope(env);
|
|
535
|
+
this->_textProcessor->enableStrongsWithNbsp();
|
|
536
|
+
unlockApi();
|
|
537
|
+
return info.Env().Undefined();
|
|
538
|
+
}
|
|
539
|
+
|
|
529
540
|
Napi::Value NodeSwordInterface::getRawModuleEntry(const Napi::CallbackInfo& info)
|
|
530
541
|
{
|
|
531
542
|
lockApi();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -70,6 +70,7 @@ private:
|
|
|
70
70
|
Napi::Value getLocalModule(const Napi::CallbackInfo& info);
|
|
71
71
|
|
|
72
72
|
Napi::Value enableMarkup(const Napi::CallbackInfo& info);
|
|
73
|
+
Napi::Value enableStrongsWithNbsp(const Napi::CallbackInfo& info);
|
|
73
74
|
|
|
74
75
|
Napi::Value getRawModuleEntry(const Napi::CallbackInfo& info);
|
|
75
76
|
Napi::Value getReferenceText(const Napi::CallbackInfo& info);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -141,13 +141,28 @@ vector<Verse> ModuleSearch::getModuleSearchResults(string moduleName,
|
|
|
141
141
|
return searchResults;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
//
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
144
|
+
// Cut out the number from the Strong's key (starting at index 1 until end of string)
|
|
145
|
+
string strongsNumber = searchTerm.substr(1, searchTerm.size());
|
|
146
|
+
|
|
147
|
+
if (searchTerm[0] == 'H') {
|
|
148
|
+
|
|
149
|
+
if (this->_textProcessor.moduleHasStrongsPaddedZeroPrefixes(module)) {
|
|
150
|
+
string paddedStrongsNumber = this->_textProcessor.padStrongsNumber(strongsNumber);
|
|
151
|
+
searchTerm = "H" + paddedStrongsNumber;
|
|
152
|
+
|
|
153
|
+
} else if (this->_textProcessor.moduleHasStrongsZeroPrefixes(module)) {
|
|
154
|
+
// If the Strong's key is OT we need to insert a zero in front of the key
|
|
155
|
+
// This is necessary because the Sword modules with Strong's have a zero in front of the Hebrew Strong's numbers
|
|
156
|
+
// Overwrite the searchTerm with an inserted 0
|
|
157
|
+
searchTerm = "H0" + strongsNumber;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
} else if (searchTerm[0] == 'G') {
|
|
161
|
+
|
|
162
|
+
if (this->_textProcessor.moduleHasStrongsPaddedZeroPrefixes(module)) {
|
|
163
|
+
string paddedStrongsNumber = this->_textProcessor.padStrongsNumber(strongsNumber);
|
|
164
|
+
searchTerm = "G" + paddedStrongsNumber;
|
|
165
|
+
}
|
|
151
166
|
}
|
|
152
167
|
|
|
153
168
|
// from swmodule.h api docs:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
#include <sstream>
|
|
21
21
|
#include <string>
|
|
22
22
|
#include <regex>
|
|
23
|
+
#include <iomanip>
|
|
23
24
|
|
|
24
25
|
// Sword includes
|
|
25
26
|
#include <versekey.h>
|
|
@@ -40,6 +41,7 @@ TextProcessor::TextProcessor(ModuleStore& moduleStore, ModuleHelper& moduleHelpe
|
|
|
40
41
|
: _moduleStore(moduleStore), _moduleHelper(moduleHelper)
|
|
41
42
|
{
|
|
42
43
|
this->_markupEnabled = false;
|
|
44
|
+
this->_strongsWithNbspEnabled = false;
|
|
43
45
|
this->_rawMarkupEnabled = false;
|
|
44
46
|
}
|
|
45
47
|
|
|
@@ -210,7 +212,7 @@ string TextProcessor::getFilteredText(const string& text, int chapter, int verse
|
|
|
210
212
|
}
|
|
211
213
|
}
|
|
212
214
|
|
|
213
|
-
if (hasStrongs) {
|
|
215
|
+
if (hasStrongs && this->_strongsWithNbspEnabled) {
|
|
214
216
|
filteredText = this->replaceSpacesInStrongs(filteredText);
|
|
215
217
|
}
|
|
216
218
|
|
|
@@ -533,6 +535,7 @@ string TextProcessor::replaceSpacesInStrongs(const string& text)
|
|
|
533
535
|
filteredText += std::regex_replace(m[0].str(), space, " ");
|
|
534
536
|
input = m.suffix();
|
|
535
537
|
}
|
|
538
|
+
|
|
536
539
|
filteredText += input;
|
|
537
540
|
|
|
538
541
|
return filteredText;
|
|
@@ -548,7 +551,38 @@ bool TextProcessor::moduleHasStrongsZeroPrefixes(sword::SWModule* module)
|
|
|
548
551
|
string verseText = this->getCurrentVerseText(module, true);
|
|
549
552
|
this->_markupEnabled = previousMarkupSetting;
|
|
550
553
|
|
|
551
|
-
|
|
554
|
+
// Check if the verse text contains the Strong's number H07225 ("beginning") with a zero prefix
|
|
555
|
+
return verseText.find("strong:H07225") != string::npos;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
bool TextProcessor::moduleHasStrongsPaddedZeroPrefixes(sword::SWModule* module)
|
|
559
|
+
{
|
|
560
|
+
// Check if the module has Strongs's numbers that are padded with zeros
|
|
561
|
+
string key = "Gen 2:24";
|
|
562
|
+
module->setKey(key.c_str());
|
|
563
|
+
|
|
564
|
+
bool previousMarkupSetting = this->_markupEnabled;
|
|
565
|
+
this->enableMarkup();
|
|
566
|
+
string verseText = this->getCurrentVerseText(module, true);
|
|
567
|
+
this->_markupEnabled = previousMarkupSetting;
|
|
568
|
+
|
|
569
|
+
// Check if the verse text contains the Strong's number H0001 ("father") with padded zeros
|
|
570
|
+
return verseText.find("strong:H0001") != string::npos;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
string TextProcessor::padStrongsNumber(const string strongsNumber) {
|
|
574
|
+
if (strongsNumber.size() == 0) {
|
|
575
|
+
return strongsNumber;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
// Convert to int
|
|
579
|
+
int numericValue = stoi(strongsNumber);
|
|
580
|
+
|
|
581
|
+
// Use stringstream and i/o manipulators to pad with zeros
|
|
582
|
+
std::ostringstream padded;
|
|
583
|
+
padded << std::setw(4) << std::setfill('0') << numericValue;
|
|
584
|
+
|
|
585
|
+
return padded.str();
|
|
552
586
|
}
|
|
553
587
|
|
|
554
588
|
bool TextProcessor::isModuleReadable(sword::SWModule* module, std::string key)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2025 Tobias Klein <contact@tklein.info>
|
|
4
4
|
|
|
5
5
|
node-sword-interface is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU General Public License as published by
|
|
@@ -38,6 +38,8 @@ public:
|
|
|
38
38
|
void enableMarkup() { this->_markupEnabled = true; }
|
|
39
39
|
void disableMarkup() { this->_markupEnabled = false; }
|
|
40
40
|
|
|
41
|
+
void enableStrongsWithNbsp() { this->_strongsWithNbspEnabled = true; }
|
|
42
|
+
|
|
41
43
|
std::vector<Verse> getBibleText(std::string moduleName);
|
|
42
44
|
Verse getReferenceText(std::string moduleName, std::string reference);
|
|
43
45
|
std::vector<Verse> getBookText(std::string moduleName, std::string bookCode, int startVerseNumber=-1, int verseCount=-1);
|
|
@@ -50,6 +52,8 @@ public:
|
|
|
50
52
|
StrongsEntry* getStrongsEntry(std::string key);
|
|
51
53
|
|
|
52
54
|
bool moduleHasStrongsZeroPrefixes(sword::SWModule* module);
|
|
55
|
+
bool moduleHasStrongsPaddedZeroPrefixes(sword::SWModule* module);
|
|
56
|
+
std::string padStrongsNumber(const std::string strongsNumber);
|
|
53
57
|
bool isModuleReadable(sword::SWModule* module, std::string key="John 1:1");
|
|
54
58
|
|
|
55
59
|
private:
|
|
@@ -71,6 +75,7 @@ private:
|
|
|
71
75
|
ModuleHelper& _moduleHelper;
|
|
72
76
|
bool _markupEnabled;
|
|
73
77
|
bool _rawMarkupEnabled;
|
|
78
|
+
bool _strongsWithNbspEnabled;
|
|
74
79
|
};
|
|
75
80
|
|
|
76
81
|
#endif // _TEXT_PROCESSOR
|