PinInPy 1.0.5__tar.gz → 1.0.7__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.
- {pininpy-1.0.5 → pininpy-1.0.7}/PKG-INFO +1 -1
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/CMakeLists.txt +1 -1
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/include/PinIn4Cpp/detail/AdaptiveContainers.h +3 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/include/PinIn4Cpp/detail/ObjectPool.h +5 -11
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/src/Keyboard.cpp +18 -8
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/src/PinInCAPI.cpp +1 -1
- {pininpy-1.0.5 → pininpy-1.0.7}/pyproject.toml +1 -1
- {pininpy-1.0.5 → pininpy-1.0.7}/.editorconfig +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/.github/workflows/python-publish.yml +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/.gitignore +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/.gitmodules +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/CMakeLists.txt +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/LICENSE +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/.editorconfig +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/.gitattributes +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/.gitignore +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/CMakeSettings.json +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/FFIExample/PinInLua.lua +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/LICENSE +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/README.md +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/cmake/PinIn4CppConfig.cmake.in +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/example/PinyinTest.cpp +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/include/PinIn4Cpp/Keyboard.h +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/include/PinIn4Cpp/ParallelSearch.h +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/include/PinIn4Cpp/PinIn.h +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/include/PinIn4Cpp/PinInCAPI.h +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/include/PinIn4Cpp/PinyinFormat.h +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/include/PinIn4Cpp/TreeSearcher.h +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/include/PinIn4Cpp/detail/Accelerator.h +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/include/PinIn4Cpp/detail/BinUtils.h +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/include/PinIn4Cpp/detail/IndexSet.h +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/include/PinIn4Cpp/detail/StringPool.h +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/include/PinIn4Cpp/detail/StringUtils.h +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/licenses/PinIn.txt +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/licenses/pinyin-data.txt +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/src/PinIn.cpp +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/src/PinyinFormat.cpp +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/src/TreeSearcher.cpp +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/src/utils/Accelerator.cpp +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/src/utils/BinUtils.cpp +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/src/utils/IndexSet.cpp +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/src/utils/StringPool.cpp +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/src/utils/StringUtils.cpp +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/test_data/large.txt +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/test_data/pinyin.txt +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/PinIn4Cpp/test_data/small.txt +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/README.md +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/build_cffi.py +0 -0
- {pininpy-1.0.5 → pininpy-1.0.7}/package/__init__.py +0 -0
|
@@ -31,6 +31,7 @@ namespace PinInCpp {
|
|
|
31
31
|
if (this == &src) {
|
|
32
32
|
return *this;
|
|
33
33
|
}
|
|
34
|
+
TrueClear();//如果覆盖的是一个原本就有的数组,那么这个会检查并清理旧数据
|
|
34
35
|
copy(src);
|
|
35
36
|
return *this;
|
|
36
37
|
}
|
|
@@ -38,6 +39,7 @@ namespace PinInCpp {
|
|
|
38
39
|
if (this == &src) {
|
|
39
40
|
return *this;
|
|
40
41
|
}
|
|
42
|
+
TrueClear();//如果覆盖的是一个原本就有的数组,那么这个会检查并清理旧数据
|
|
41
43
|
move(std::forward<SVOArray&&>(src));//确保类型绝对正确
|
|
42
44
|
return *this;
|
|
43
45
|
}
|
|
@@ -197,6 +199,7 @@ namespace PinInCpp {
|
|
|
197
199
|
if (dataSize > SVOsize) {
|
|
198
200
|
::operator delete (data.longData.data, HeapAlign);
|
|
199
201
|
}
|
|
202
|
+
dataSize = 0;//返回小向量模式,避免二次析构出问题
|
|
200
203
|
throw;
|
|
201
204
|
}
|
|
202
205
|
}
|
|
@@ -144,19 +144,13 @@ namespace PinInCpp {
|
|
|
144
144
|
SlabAllocator& operator=(const SlabAllocator&) = delete;
|
|
145
145
|
|
|
146
146
|
SlabAllocator(SlabAllocator&& src)noexcept {
|
|
147
|
-
data
|
|
148
|
-
head
|
|
149
|
-
src.data = nullptr;
|
|
150
|
-
src.head = nullptr;
|
|
147
|
+
std::swap(data, src.data);//Move-and-Swap,由于自身现在是空的,所以相当于把src置空了
|
|
148
|
+
std::swap(head, src.head);
|
|
151
149
|
}
|
|
152
150
|
SlabAllocator& operator=(SlabAllocator&& src)noexcept {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
data = src.data;
|
|
157
|
-
head = src.head;
|
|
158
|
-
src.data = nullptr;
|
|
159
|
-
src.head = nullptr;
|
|
151
|
+
SlabAllocator tmp(std::move(src));//临时变量退出作用域自动析构
|
|
152
|
+
std::swap(data, tmp.data);
|
|
153
|
+
std::swap(head, tmp.head);
|
|
160
154
|
return *this;
|
|
161
155
|
}
|
|
162
156
|
|
|
@@ -169,14 +169,24 @@ namespace PinInCpp {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
+
else {//防止多重赋值的问题,下面也是
|
|
173
|
+
MapLocalFuzzy = std::nullopt;
|
|
174
|
+
}
|
|
175
|
+
|
|
172
176
|
if (src.MapKeys.has_value()) {
|
|
173
177
|
MapKeys = std::map<std::string_view, std::string_view>();
|
|
174
178
|
ViewDeepCopy(src.pool, src.MapKeys.value(), MapKeys.value());
|
|
175
179
|
}
|
|
180
|
+
else {
|
|
181
|
+
MapKeys = std::nullopt;
|
|
182
|
+
}
|
|
176
183
|
if (src.MapLocal.has_value()) {
|
|
177
184
|
MapLocal = std::map<std::string_view, std::string_view>();
|
|
178
185
|
ViewDeepCopy(src.pool, src.MapLocal.value(), MapLocal.value());
|
|
179
186
|
}
|
|
187
|
+
else {
|
|
188
|
+
MapLocal = std::nullopt;
|
|
189
|
+
}
|
|
180
190
|
}
|
|
181
191
|
|
|
182
192
|
std::string_view Keyboard::keys(std::string_view s)const noexcept {
|
|
@@ -378,12 +388,12 @@ namespace PinInCpp {
|
|
|
378
388
|
|
|
379
389
|
const Keyboard Keyboard::QUANPIN = Keyboard(std::nullopt, std::nullopt, Keyboard::Standard, false, true);
|
|
380
390
|
const Keyboard Keyboard::DAQIAN = Keyboard(PHONETIC_LOCAL, DAQIAN_KEYS, Keyboard::Standard, false, false);
|
|
381
|
-
const Keyboard Keyboard::XIAOHE = Keyboard(std::nullopt, XIAOHE_KEYS, Keyboard::Zero,
|
|
382
|
-
const Keyboard Keyboard::ZIRANMA = Keyboard(std::nullopt, ZIRANMA_KEYS, Keyboard::Zero,
|
|
383
|
-
const Keyboard Keyboard::SOUGOU = Keyboard(std::nullopt, SOUGOU_KEYS, Keyboard::ZeroOInitial,
|
|
384
|
-
const Keyboard Keyboard::ZHINENG_ABC = Keyboard(std::nullopt, ZHINENG_ABC_KEYS, Keyboard::ZeroOInitial,
|
|
385
|
-
const Keyboard Keyboard::GUOBIAO = Keyboard(std::nullopt, GUOBIAO_KEYS, Keyboard::ZeroAInitial,
|
|
386
|
-
const Keyboard Keyboard::MICROSOFT = Keyboard(std::nullopt, MICROSOFT_KEYS, Keyboard::ZeroOInitial,
|
|
387
|
-
const Keyboard Keyboard::PINYINPP = Keyboard(std::nullopt, PINYINPP_KEYS, Keyboard::Zero,
|
|
388
|
-
const Keyboard Keyboard::ZIGUANG = Keyboard(std::nullopt, ZIGUANG_KEYS, Keyboard::ZeroOInitial,
|
|
391
|
+
const Keyboard Keyboard::XIAOHE = Keyboard(std::nullopt, XIAOHE_KEYS, Keyboard::Zero, false, false);
|
|
392
|
+
const Keyboard Keyboard::ZIRANMA = Keyboard(std::nullopt, ZIRANMA_KEYS, Keyboard::Zero, false, false);
|
|
393
|
+
const Keyboard Keyboard::SOUGOU = Keyboard(std::nullopt, SOUGOU_KEYS, Keyboard::ZeroOInitial, false, false);
|
|
394
|
+
const Keyboard Keyboard::ZHINENG_ABC = Keyboard(std::nullopt, ZHINENG_ABC_KEYS, Keyboard::ZeroOInitial, false, false);
|
|
395
|
+
const Keyboard Keyboard::GUOBIAO = Keyboard(std::nullopt, GUOBIAO_KEYS, Keyboard::ZeroAInitial, false, false);
|
|
396
|
+
const Keyboard Keyboard::MICROSOFT = Keyboard(std::nullopt, MICROSOFT_KEYS, Keyboard::ZeroOInitial, false, false);
|
|
397
|
+
const Keyboard Keyboard::PINYINPP = Keyboard(std::nullopt, PINYINPP_KEYS, Keyboard::Zero, false, false);
|
|
398
|
+
const Keyboard Keyboard::ZIGUANG = Keyboard(std::nullopt, ZIGUANG_KEYS, Keyboard::ZeroOInitial, false, false);
|
|
389
399
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|