wowool-sdk-cpp 3.6.3__tar.gz → 3.6.4__tar.gz

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.
Files changed (24) hide show
  1. {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/PKG-INFO +1 -1
  2. wowool_sdk_cpp-3.6.4/sdk_version.txt +1 -0
  3. wowool_sdk_cpp-3.6.4/version.txt +1 -0
  4. {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/wowool/native/core/wowool_sdk.cpp +43 -43
  5. {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/wowool_sdk_cpp.egg-info/PKG-INFO +1 -1
  6. wowool_sdk_cpp-3.6.3/sdk_version.txt +0 -1
  7. wowool_sdk_cpp-3.6.3/version.txt +0 -1
  8. {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/MANIFEST.in +0 -0
  9. {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/common_setup.py +0 -0
  10. {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/install_requires.txt +0 -0
  11. {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/install_requires_wowool.txt +0 -0
  12. {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/long_description.md +0 -0
  13. {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/pre_setup.py +0 -0
  14. {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/pyproject.toml +0 -0
  15. {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/setup.cfg +0 -0
  16. {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/setup.py +0 -0
  17. {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/wowool/package/lib/wowool_plugin.py +0 -0
  18. {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/wowool/package/lib/wowool_sdk.py +0 -0
  19. {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/wowool/plugin/wowool_plugin.cpp +0 -0
  20. {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/wowool/plugin/wowool_plugin.hpp +0 -0
  21. {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/wowool_sdk_cpp.egg-info/SOURCES.txt +0 -0
  22. {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/wowool_sdk_cpp.egg-info/dependency_links.txt +0 -0
  23. {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/wowool_sdk_cpp.egg-info/not-zip-safe +0 -0
  24. {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/wowool_sdk_cpp.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wowool-sdk-cpp
3
- Version: 3.6.3
3
+ Version: 3.6.4
4
4
  Summary: Wowool NLP Toolkit C++ SDK Python Bindings, (use nlp-wowool-sdk instead if you want the Python SDK)
5
5
  Author: Wowool
6
6
  Requires-Python: >=3.11
@@ -0,0 +1 @@
1
+ 3.3.1
@@ -0,0 +1 @@
1
+ 3.6.4
@@ -38,15 +38,13 @@ namespace py = pybind11;
38
38
  std::mutex global_python_mutex;
39
39
  #define PYTHON_LOCK std::lock_guard<std::mutex> guard(global_python_mutex);
40
40
 
41
- bool get_environment_bool(std::string const &env_id, bool default_value)
42
- {
43
- char const *value_ptr = std::getenv(env_id.c_str());
44
- if (value_ptr)
45
- {
46
- std::string value(value_ptr);
47
- return value == "true" || value == "True";
48
- }
49
- return default_value;
41
+ bool get_environment_bool(std::string const &env_id, bool default_value) {
42
+ char const *value_ptr = std::getenv(env_id.c_str());
43
+ if (value_ptr) {
44
+ std::string value(value_ptr);
45
+ return value == "true" || value == "True";
46
+ }
47
+ return default_value;
50
48
  }
51
49
 
52
50
  bool lock_gil = get_environment_bool("WOWOOL_LOCK_GIL", false);
@@ -119,6 +117,18 @@ wowool::common::Options convert_py_2_api_options(py::dict const &kwargs) {
119
117
  return options;
120
118
  }
121
119
 
120
+ py::object resolve_license_key_provider(py::dict &kwargs) {
121
+ py::object license_key = py::none();
122
+ if (kwargs.contains("license_key_provider")) {
123
+ py::module pysdk =
124
+ py::module::import("wowool.native.core.lic_key_provider");
125
+ auto decode_license_key_provider =
126
+ pysdk.attr("decode_license_key_provider");
127
+ license_key = decode_license_key_provider(kwargs["license_key_provider"]);
128
+ }
129
+ return license_key; // py::object
130
+ }
131
+
122
132
  std::string convert_filterset(wowool::filter::Filter const &filterset) {
123
133
  return filterset.info();
124
134
  }
@@ -160,26 +170,10 @@ public:
160
170
 
161
171
  typedef wowool::engine::Engine type;
162
172
 
163
- // using wowool::engine::Engine::Engine;
164
-
165
- // engine_t(wowool::engine::Engine const &&base)
166
- // : wowool::engine::Engine(std::move(base))
167
- // {
168
- // std::cout << "PLUGIN wowool::engine::Engine(wowool::engine::Engine const
169
- // &&base)" << this << std::endl;
170
- // }
171
-
172
- // engine_t(wowool::engine::Engine const &&base, py::dict const &kwarg)
173
- // : wowool::engine::Engine(tir::pywowool::convert_py_2_api_options(kwarg))
174
- // {
175
- // std::cout << "PLUGIN wowool::engine::Engine(wowool::engine::Engine const
176
- // &&base, py::dict const &kwarg)" << this << std::endl;
177
- // }
178
-
179
173
  // we need this one to be able to create multi_process objects.
180
- engine_t(py::dict const &kwarg)
181
- : wowool::engine::Engine(tir::pywowool::convert_py_2_api_options(kwarg)) {
182
- }
174
+ engine_t(py::dict const &kwargs)
175
+ : wowool::engine::Engine(
176
+ tir::pywowool::convert_py_2_api_options(kwargs)) {}
183
177
  };
184
178
 
185
179
  class lid_t : public wowool::language_identifier::LanguageIdentifier {
@@ -191,14 +185,14 @@ public:
191
185
  lid_t(wowool::language_identifier::LanguageIdentifier const &&base)
192
186
  : wowool::language_identifier::LanguageIdentifier(std::move(base)) {}
193
187
 
194
- lid_t(wowool::analyzer::Engine const &engine, py::dict const &kwarg)
188
+ lid_t(wowool::analyzer::Engine const &engine, py::dict const &kwargs)
195
189
  : wowool::language_identifier::LanguageIdentifier(
196
- engine, tir::pywowool::convert_py_2_api_options(kwarg)) {}
190
+ engine, tir::pywowool::convert_py_2_api_options(kwargs)) {}
197
191
 
198
- lid_t(py::dict const &kwarg)
192
+ lid_t(py::dict const &kwargs)
199
193
  : wowool::language_identifier::LanguageIdentifier(
200
194
  tir::pywowool::get_default_engine(global_shared_engine_options),
201
- tir::pywowool::convert_py_2_api_options(kwarg)) {}
195
+ tir::pywowool::convert_py_2_api_options(kwargs)) {}
202
196
  };
203
197
 
204
198
  class domain_t : public wowool::domain::Domain {
@@ -211,17 +205,17 @@ public:
211
205
  : wowool::domain::Domain(std::move(base)) {}
212
206
 
213
207
  domain_t(wowool::analyzer::Engine const &engine,
214
- std::string const domain_descriptor, py::dict const &kwarg)
215
- : wowool::domain::Domain(engine, domain_descriptor,
216
- tir::pywowool::convert_py_2_api_options(kwarg)) {
217
- }
208
+ std::string const domain_descriptor, py::dict const &kwargs)
209
+ : wowool::domain::Domain(
210
+ engine, domain_descriptor,
211
+ tir::pywowool::convert_py_2_api_options(kwargs)) {}
218
212
 
219
213
  // we need this one to be able to create multi_process objects.
220
- domain_t(py::dict const &kwarg)
214
+ domain_t(py::dict const &kwargs)
221
215
  : wowool::domain::Domain(
222
216
  tir::pywowool::get_default_engine(global_shared_engine_options),
223
- kwarg["name"].cast<std::string>(),
224
- tir::pywowool::convert_py_2_api_options(kwarg)) {}
217
+ kwargs["name"].cast<std::string>(),
218
+ tir::pywowool::convert_py_2_api_options(kwargs)) {}
225
219
 
226
220
  // wowool::analyzer::Results process(wowool::analyzer::Results const document)
227
221
  // {
@@ -280,10 +274,10 @@ public:
280
274
  analyzer_t(wowool::analyzer::Analyzer const &&base)
281
275
  : wowool::analyzer::Analyzer(std::move(base)) {}
282
276
 
283
- analyzer_t(wowool::analyzer::Engine const &engine, py::dict const &kwarg)
277
+ analyzer_t(wowool::analyzer::Engine const &engine, py::dict const &kwargs)
284
278
  : wowool::analyzer::Analyzer(
285
- engine, tir::pywowool::convert_py_2_api_options(kwarg)),
286
- _kwargs(kwarg) {}
279
+ engine, tir::pywowool::convert_py_2_api_options(kwargs)),
280
+ _kwargs(kwargs) {}
287
281
 
288
282
  std::string
289
283
  process_return_string(std::string const &document,
@@ -460,10 +454,16 @@ PYBIND11_MODULE(_wowool_sdk, m)
460
454
  })
461
455
  .def("__getstate__", [](wowool::engine::Engine const& self) {
462
456
  py::dict kwargs = tir::pywowool::convert_options_2_py(self.options);
457
+ kwargs.attr("pop")("license_key", py::none());
463
458
  return kwargs;
464
459
  })
465
460
  .def("__setstate__", [](py::object self, py::dict kwargs) {
466
- // std::cout << "PLUGIN __setstate__ wowool::engine::Engine(py::dict const& kwargs)" << std::endl;
461
+ auto license_key = tir::pywowool::resolve_license_key_provider(kwargs);
462
+ if (!license_key.is_none()) {
463
+ std::string value = py::str(license_key);
464
+ if (value.length() > 0)
465
+ kwargs["license_key"] = license_key;
466
+ }
467
467
  auto& p = self.cast<tir::pywowool::engine_t&>();
468
468
  new (&p) tir::pywowool::engine_t(kwargs);
469
469
  })
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wowool-sdk-cpp
3
- Version: 3.6.3
3
+ Version: 3.6.4
4
4
  Summary: Wowool NLP Toolkit C++ SDK Python Bindings, (use nlp-wowool-sdk instead if you want the Python SDK)
5
5
  Author: Wowool
6
6
  Requires-Python: >=3.11
@@ -1 +0,0 @@
1
- 3.3.0
@@ -1 +0,0 @@
1
- 3.6.3
File without changes
File without changes