node-sword-interface 1.0.32 → 1.0.34
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 +2 -1
- package/examples/install_kjv.js +1 -1
- package/examples/print_kjv_matthew.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/scripts/build_sword.sh +4 -4
- package/scripts/get_sword_build_win32.ps1 +2 -2
- 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 +4 -4
- package/src/napi_module/node_sword_interface.hpp +1 -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 +34 -2
- package/src/sword_backend/text_processor.hpp +3 -1
package/CMakeLists.txt
CHANGED
|
@@ -17,9 +17,10 @@ link_directories(${CMAKE_SOURCE_DIR}/sword_build)
|
|
|
17
17
|
find_package(ZLIB REQUIRED)
|
|
18
18
|
find_package(CURL REQUIRED)
|
|
19
19
|
find_package(BZip2 REQUIRED)
|
|
20
|
+
find_package(LibLZMA REQUIRED)
|
|
20
21
|
|
|
21
22
|
set(SWORD_LIBRARY_NAME "libsword.a")
|
|
22
|
-
set(DEPENDENT_LIBS ${ZLIB_LIBRARIES} ${CURL_LIBRARIES} ${BZIP2_LIBRARIES})
|
|
23
|
+
set(DEPENDENT_LIBS ${ZLIB_LIBRARIES} ${CURL_LIBRARIES} ${BZIP2_LIBRARIES} ${LIBLZMA_LIBRARIES})
|
|
23
24
|
|
|
24
25
|
if (UNIX)
|
|
25
26
|
set(DEPENDENT_LIBS ${DEPENDENT_LIBS} pthread)
|
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
|
package/package.json
CHANGED
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
|
|
@@ -30,8 +30,8 @@ else
|
|
|
30
30
|
fi
|
|
31
31
|
|
|
32
32
|
# CLONE SWORD
|
|
33
|
-
git clone https://github.com/
|
|
34
|
-
git -C sword checkout
|
|
33
|
+
git clone https://github.com/ezra-bible-app/crosswire-sword-mirror sword
|
|
34
|
+
git -C sword checkout 1.9.0-2025-02-24
|
|
35
35
|
patch --batch --forward -d sword -p 0 < patch/sword_globconf.patch
|
|
36
36
|
|
|
37
37
|
# PATCHES
|
|
@@ -75,7 +75,7 @@ else
|
|
|
75
75
|
# macOS & Linux
|
|
76
76
|
|
|
77
77
|
cd sword_build
|
|
78
|
-
cmake -DLIBSWORD_LIBRARY_TYPE=Static -DCMAKE_CXX_STANDARD=11 -DCMAKE_BUILD_TYPE=
|
|
78
|
+
cmake -DLIBSWORD_LIBRARY_TYPE=Static -DCMAKE_CXX_STANDARD=11 -DCMAKE_BUILD_TYPE=Debug \
|
|
79
79
|
-DCMAKE_DISABLE_FIND_PACKAGE_ICU=TRUE \
|
|
80
80
|
../sword
|
|
81
81
|
fi
|
|
@@ -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
|
|
@@ -34,7 +34,7 @@ $headers = @{}
|
|
|
34
34
|
$github_token = $env:GITHUB_TOKEN
|
|
35
35
|
|
|
36
36
|
# --- Set the uri for the release
|
|
37
|
-
$URI = "https://api.github.com/repos/ezra-bible-app/sword-build-win32/releases/tags/v1.
|
|
37
|
+
$URI = "https://api.github.com/repos/ezra-bible-app/sword-build-win32/releases/tags/v1.9.0-2025-02-23"
|
|
38
38
|
|
|
39
39
|
if ($Env:CI -eq "true") {
|
|
40
40
|
Write-Host "GitHub actions build ... using GITHUB_TOKEN for authentication!"
|
|
@@ -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
|
|
@@ -983,11 +983,11 @@ Napi::Value NodeSwordInterface::getSwordVersion(const Napi::CallbackInfo& info)
|
|
|
983
983
|
Napi::HandleScope scope(env);
|
|
984
984
|
|
|
985
985
|
#if defined(__ANDROID__)
|
|
986
|
-
string version = "1.9.0-
|
|
986
|
+
string version = "1.9.0-1460f91 (SVN Rev. 3873)";
|
|
987
987
|
#elif defined(__linux__) || defined(__APPLE__)
|
|
988
|
-
string version = "1.9.0-
|
|
988
|
+
string version = "1.9.0-1460f91 (SVN Rev. 3873)";
|
|
989
989
|
#elif _WIN32
|
|
990
|
-
string version = "1.9.0-
|
|
990
|
+
string version = "1.9.0-1460f91 (SVN Rev. 3873)";
|
|
991
991
|
#endif
|
|
992
992
|
|
|
993
993
|
Napi::String swVersion = Napi::String::New(env, version);
|
|
@@ -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
|
|
@@ -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>
|
|
@@ -550,7 +551,38 @@ bool TextProcessor::moduleHasStrongsZeroPrefixes(sword::SWModule* module)
|
|
|
550
551
|
string verseText = this->getCurrentVerseText(module, true);
|
|
551
552
|
this->_markupEnabled = previousMarkupSetting;
|
|
552
553
|
|
|
553
|
-
|
|
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();
|
|
554
586
|
}
|
|
555
587
|
|
|
556
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
|
|
@@ -52,6 +52,8 @@ public:
|
|
|
52
52
|
StrongsEntry* getStrongsEntry(std::string key);
|
|
53
53
|
|
|
54
54
|
bool moduleHasStrongsZeroPrefixes(sword::SWModule* module);
|
|
55
|
+
bool moduleHasStrongsPaddedZeroPrefixes(sword::SWModule* module);
|
|
56
|
+
std::string padStrongsNumber(const std::string strongsNumber);
|
|
55
57
|
bool isModuleReadable(sword::SWModule* module, std::string key="John 1:1");
|
|
56
58
|
|
|
57
59
|
private:
|