node-sword-interface 0.244.0 → 0.248.0
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/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 +2 -3
- 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/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 +1 -1
- package/src/napi_module/node_sword_interface.hpp +1 -1
- package/src/napi_module/worker.hpp +1 -1
- package/src/node_sword_cli.cpp +12 -2
- package/src/sword_backend/common_defs.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 +1 -1
- 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 +16 -10
- package/src/sword_backend/text_processor.hpp +2 -2
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 - 2022 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 - 2022 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 - 2022 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 - 2022 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
|
|
@@ -77,13 +77,12 @@ if [ "$1" = "--android" ] ; then
|
|
|
77
77
|
-DCMAKE_BUILD_TYPE=Release \
|
|
78
78
|
-DANDROID_ABI="$ANDROID_ABI" \
|
|
79
79
|
-DNODYNCAST=1 \
|
|
80
|
-
-DSWORD_NO_ZLIB=Yes \
|
|
81
80
|
../sword
|
|
82
81
|
else
|
|
83
82
|
# macOS & Linux
|
|
84
83
|
|
|
85
84
|
cd sword_build
|
|
86
|
-
cmake -DLIBSWORD_LIBRARY_TYPE=Static -DCMAKE_CXX_STANDARD=11
|
|
85
|
+
cmake -DLIBSWORD_LIBRARY_TYPE=Static -DCMAKE_CXX_STANDARD=11 ../sword
|
|
87
86
|
fi
|
|
88
87
|
|
|
89
88
|
make -j4 sword_static
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This file is part of node-sword-interface.
|
|
2
2
|
#
|
|
3
|
-
# Copyright (C) 2019 -
|
|
3
|
+
# Copyright (C) 2019 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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/src/node_sword_cli.cpp
CHANGED
|
@@ -114,6 +114,14 @@ void get_book_list(ModuleHelper& module_helper)
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
void get_book_headers(TextProcessor& text_processor)
|
|
118
|
+
{
|
|
119
|
+
vector<Verse> headerList = text_processor.getBookHeaderList("NASB", "John");
|
|
120
|
+
for (int i = 0; i < headerList.size(); i++) {
|
|
121
|
+
cout << headerList[i].content << endl;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
117
125
|
void test_unlock_key(ModuleInstaller& module_installer, ModuleStore& module_store, TextProcessor& text_processor)
|
|
118
126
|
{
|
|
119
127
|
module_installer.uninstallModule("NA28");
|
|
@@ -206,11 +214,13 @@ int main(int argc, char** argv)
|
|
|
206
214
|
//string translation = sword_facade.getSwordTranslation(string("/usr/share/sword/locales.d"), string("de"), string("locales"));
|
|
207
215
|
//cout << translation << endl;
|
|
208
216
|
|
|
209
|
-
vector<Verse> searchResults = moduleSearch.getModuleSearchResults("NASB", "faith", SearchType::multiWord, SearchScope::NT, true);
|
|
217
|
+
/*vector<Verse> searchResults = moduleSearch.getModuleSearchResults("NASB", "faith", SearchType::multiWord, SearchScope::NT, true);
|
|
210
218
|
cout << "Got " << searchResults.size() << " results!" << endl;
|
|
211
219
|
for (unsigned int i=0; i < searchResults.size(); i++) {
|
|
212
220
|
cout << searchResults[i].reference << endl;
|
|
213
|
-
}
|
|
221
|
+
}*/
|
|
222
|
+
|
|
223
|
+
get_book_headers(textProcessor);
|
|
214
224
|
|
|
215
225
|
return 0;
|
|
216
226
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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 - 2022 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
|
|
@@ -36,8 +36,6 @@
|
|
|
36
36
|
using namespace std;
|
|
37
37
|
using namespace sword;
|
|
38
38
|
|
|
39
|
-
#define SEARCHTYPE_ENTRYATTR -3L
|
|
40
|
-
|
|
41
39
|
TextProcessor::TextProcessor(ModuleStore& moduleStore, ModuleHelper& moduleHelper)
|
|
42
40
|
: _moduleStore(moduleStore), _moduleHelper(moduleHelper)
|
|
43
41
|
{
|
|
@@ -45,7 +43,7 @@ TextProcessor::TextProcessor(ModuleStore& moduleStore, ModuleHelper& moduleHelpe
|
|
|
45
43
|
this->_rawMarkupEnabled = false;
|
|
46
44
|
}
|
|
47
45
|
|
|
48
|
-
string TextProcessor::getFilteredText(const string& text, int chapter, bool hasStrongs, bool hasDuplicateClosingEndDivs)
|
|
46
|
+
string TextProcessor::getFilteredText(const string& text, int chapter, int verseNr, bool hasStrongs, bool hasDuplicateClosingEndDivs)
|
|
49
47
|
{
|
|
50
48
|
//static regex schlachterMarkupFilter = regex("<H.*> ");
|
|
51
49
|
static string chapterFilter = "<chapter";
|
|
@@ -72,6 +70,8 @@ string TextProcessor::getFilteredText(const string& text, int chapter, bool hasS
|
|
|
72
70
|
static string quoteElementFilter = "<q ";
|
|
73
71
|
static string titleStartElementFilter = "<title";
|
|
74
72
|
static string titleEndElementFilter = "</title>";
|
|
73
|
+
static string segStartElementFilter = "<seg>";
|
|
74
|
+
static string segEndElementFilter = "</seg>";
|
|
75
75
|
static string divTitleElementFilter = "<div class=\"title\"";
|
|
76
76
|
static string secHeadClassFilter = "class=\"sechead\"";
|
|
77
77
|
static string divMilestoneFilter = "<div type=\"x-milestone\"";
|
|
@@ -128,7 +128,8 @@ string TextProcessor::getFilteredText(const string& text, int chapter, bool hasS
|
|
|
128
128
|
|
|
129
129
|
stringstream sectionTitleElement;
|
|
130
130
|
sectionTitleElement << "<div class=\"sword-markup sword-section-title\" ";
|
|
131
|
-
sectionTitleElement << "chapter=\"" << chapter << "\"";
|
|
131
|
+
sectionTitleElement << "chapter=\"" << chapter << "\" ";
|
|
132
|
+
sectionTitleElement << "verse=\"" << verseNr << "\"";
|
|
132
133
|
this->findAndReplaceAll(filteredText, titleStartElementFilter, sectionTitleElement.str());
|
|
133
134
|
this->findAndReplaceAll(filteredText, divTitleElementFilter, sectionTitleElement.str());
|
|
134
135
|
|
|
@@ -138,6 +139,8 @@ string TextProcessor::getFilteredText(const string& text, int chapter, bool hasS
|
|
|
138
139
|
this->findAndReplaceAll(filteredText, secHeadClassFilter, secHead.str());
|
|
139
140
|
|
|
140
141
|
this->findAndReplaceAll(filteredText, titleEndElementFilter, "</div>");
|
|
142
|
+
this->findAndReplaceAll(filteredText, segStartElementFilter, "");
|
|
143
|
+
this->findAndReplaceAll(filteredText, segEndElementFilter, "");
|
|
141
144
|
this->findAndReplaceAll(filteredText, divMilestoneFilter, "<div class=\"sword-markup sword-x-milestone\"");
|
|
142
145
|
this->findAndReplaceAll(filteredText, milestoneFilter, "<div class=\"sword-markup sword-milestone\"");
|
|
143
146
|
this->findAndReplaceAll(filteredText, xBrFilter, "x-br\"/> ");
|
|
@@ -183,7 +186,7 @@ string TextProcessor::getCurrentChapterHeading(sword::SWModule* module)
|
|
|
183
186
|
string chapterHeading = "";
|
|
184
187
|
VerseKey currentVerseKey = module->getKey();
|
|
185
188
|
int currentChapter = currentVerseKey.getChapter();
|
|
186
|
-
int
|
|
189
|
+
int currentVerseNr = currentVerseKey.getVerse();
|
|
187
190
|
|
|
188
191
|
if (currentVerseKey.getVerse() == 1) { // X:1, set key to X:0
|
|
189
192
|
// Include chapter/book/testament/module intros
|
|
@@ -203,10 +206,10 @@ string TextProcessor::getCurrentChapterHeading(sword::SWModule* module)
|
|
|
203
206
|
if (this->_markupEnabled && !this->_rawMarkupEnabled) {
|
|
204
207
|
// The chapter headings in the ISV are screwed up somehow for 1:1
|
|
205
208
|
// Therefore we do not render chapter headings for the first verse of the book in this case.
|
|
206
|
-
if (currentChapter == 1 &&
|
|
209
|
+
if (currentChapter == 1 && currentVerseNr == 1 && currentModuleName == "ISV") {
|
|
207
210
|
chapterHeading = "";
|
|
208
211
|
} else {
|
|
209
|
-
chapterHeading = this->getFilteredText(chapterHeading, currentChapter);
|
|
212
|
+
chapterHeading = this->getFilteredText(chapterHeading, currentChapter, currentVerseNr);
|
|
210
213
|
}
|
|
211
214
|
}
|
|
212
215
|
|
|
@@ -221,12 +224,13 @@ string TextProcessor::getCurrentVerseText(sword::SWModule* module, bool hasStron
|
|
|
221
224
|
if (this->_markupEnabled && !forceNoMarkup) {
|
|
222
225
|
VerseKey currentVerseKey = module->getKey();
|
|
223
226
|
int currentChapter = currentVerseKey.getChapter();
|
|
227
|
+
int currentVerseNr = currentVerseKey.getVerse();
|
|
224
228
|
verseText = string(module->getRawEntry());
|
|
225
229
|
StringHelper::trim(verseText);
|
|
226
230
|
filteredText = verseText;
|
|
227
231
|
|
|
228
232
|
if (!this->_rawMarkupEnabled) {
|
|
229
|
-
filteredText = this->getFilteredText(verseText, currentChapter, hasStrongs, hasDuplicateClosingEndDivs);
|
|
233
|
+
filteredText = this->getFilteredText(verseText, currentChapter, currentVerseNr, hasStrongs, hasDuplicateClosingEndDivs);
|
|
230
234
|
}
|
|
231
235
|
} else {
|
|
232
236
|
verseText = string(module->stripText());
|
|
@@ -475,7 +479,7 @@ vector<Verse> TextProcessor::getBookHeaderList(string moduleName, string bookCod
|
|
|
475
479
|
ListKey scopeList = VerseKey().parseVerseList(bookCode.c_str(), "", true);
|
|
476
480
|
SWKey* scope = &scopeList;
|
|
477
481
|
|
|
478
|
-
ListKey resultKey = module->search("/Heading", SEARCHTYPE_ENTRYATTR, 0, scope);
|
|
482
|
+
ListKey resultKey = module->search("/Heading", SWModule::SEARCHTYPE_ENTRYATTR, 0, scope);
|
|
479
483
|
|
|
480
484
|
static string titleStartElementFilter = "<title";
|
|
481
485
|
static string titleEndElementFilter = "</title>";
|
|
@@ -484,6 +488,8 @@ vector<Verse> TextProcessor::getBookHeaderList(string moduleName, string bookCod
|
|
|
484
488
|
|
|
485
489
|
for (resultKey = TOP; !resultKey.popError(); resultKey++) {
|
|
486
490
|
module->setKey(resultKey);
|
|
491
|
+
module->renderText();
|
|
492
|
+
|
|
487
493
|
VerseKey currentKey(resultKey.getShortText());
|
|
488
494
|
|
|
489
495
|
// get both Preverse and Interverse Headings and just merge them into the same map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* This file is part of node-sword-interface.
|
|
2
2
|
|
|
3
|
-
Copyright (C) 2019 -
|
|
3
|
+
Copyright (C) 2019 - 2022 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
|
|
@@ -60,7 +60,7 @@ private:
|
|
|
60
60
|
int verseCount=-1);
|
|
61
61
|
|
|
62
62
|
std::string getCurrentChapterHeading(sword::SWModule* module);
|
|
63
|
-
std::string getFilteredText(const std::string& text, int chapter, bool hasStrongs=false, bool hasDuplicateClosingEndDivs=false);
|
|
63
|
+
std::string getFilteredText(const std::string& text, int chapter, int verseNr, bool hasStrongs=false, bool hasDuplicateClosingEndDivs=false);
|
|
64
64
|
std::string replaceSpacesInStrongs(const std::string& text);
|
|
65
65
|
unsigned int findAndReplaceAll(std::string & data, std::string toSearch, std::string replaceStr);
|
|
66
66
|
|