removedup 1.0.2__tar.gz → 1.0.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 (137) hide show
  1. {removedup-1.0.2/removedup.egg-info → removedup-1.0.4}/PKG-INFO +1 -1
  2. removedup-1.0.4/dedup.cpp +45 -0
  3. removedup-1.0.4/dedup.hpp +10 -0
  4. {removedup-1.0.2 → removedup-1.0.4/removedup.egg-info}/PKG-INFO +1 -1
  5. {removedup-1.0.2 → removedup-1.0.4}/setup.py +1 -1
  6. removedup-1.0.2/dedup.cpp +0 -102
  7. removedup-1.0.2/dedup.hpp +0 -21
  8. {removedup-1.0.2 → removedup-1.0.4}/CMakeLists.txt +0 -0
  9. {removedup-1.0.2 → removedup-1.0.4}/LICENSE +0 -0
  10. {removedup-1.0.2 → removedup-1.0.4}/MANIFEST.in +0 -0
  11. {removedup-1.0.2 → removedup-1.0.4}/README.md +0 -0
  12. {removedup-1.0.2 → removedup-1.0.4}/main.cpp +0 -0
  13. {removedup-1.0.2 → removedup-1.0.4}/pyproject.toml +0 -0
  14. {removedup-1.0.2 → removedup-1.0.4}/removedup.cpp +0 -0
  15. {removedup-1.0.2 → removedup-1.0.4}/removedup.egg-info/SOURCES.txt +0 -0
  16. {removedup-1.0.2 → removedup-1.0.4}/removedup.egg-info/dependency_links.txt +0 -0
  17. {removedup-1.0.2 → removedup-1.0.4}/removedup.egg-info/not-zip-safe +0 -0
  18. {removedup-1.0.2 → removedup-1.0.4}/removedup.egg-info/requires.txt +0 -0
  19. {removedup-1.0.2 → removedup-1.0.4}/removedup.egg-info/top_level.txt +0 -0
  20. {removedup-1.0.2 → removedup-1.0.4}/setup.cfg +0 -0
  21. {removedup-1.0.2 → removedup-1.0.4}/tests/test_rdup.py +0 -0
  22. {removedup-1.0.2 → removedup-1.0.4}/vendor/cxxopts.hpp +0 -0
  23. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/CMakeLists.txt +0 -0
  24. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/LICENSE +0 -0
  25. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/attr.h +0 -0
  26. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/buffer_info.h +0 -0
  27. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/cast.h +0 -0
  28. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/chrono.h +0 -0
  29. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/common.h +0 -0
  30. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/complex.h +0 -0
  31. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/detail/class.h +0 -0
  32. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/detail/common.h +0 -0
  33. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/detail/descr.h +0 -0
  34. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/detail/init.h +0 -0
  35. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/detail/internals.h +0 -0
  36. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/detail/type_caster_base.h +0 -0
  37. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/detail/typeid.h +0 -0
  38. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/eigen/common.h +0 -0
  39. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/eigen/matrix.h +0 -0
  40. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/eigen/tensor.h +0 -0
  41. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/eigen.h +0 -0
  42. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/embed.h +0 -0
  43. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/eval.h +0 -0
  44. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/functional.h +0 -0
  45. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/gil.h +0 -0
  46. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/iostream.h +0 -0
  47. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/numpy.h +0 -0
  48. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/operators.h +0 -0
  49. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/options.h +0 -0
  50. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/pybind11.h +0 -0
  51. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/pytypes.h +0 -0
  52. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/stl/filesystem.h +0 -0
  53. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/stl.h +0 -0
  54. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/stl_bind.h +0 -0
  55. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/include/pybind11/type_caster_pyobject_ptr.h +0 -0
  56. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/CMakeLists.txt +0 -0
  57. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/cross_module_gil_utils.cpp +0 -0
  58. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/cross_module_interleaved_error_already_set.cpp +0 -0
  59. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/eigen_tensor_avoid_stl_array.cpp +0 -0
  60. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/pybind11_cross_module_tests.cpp +0 -0
  61. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/pybind11_tests.cpp +0 -0
  62. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_async.cpp +0 -0
  63. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_buffers.cpp +0 -0
  64. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_builtin_casters.cpp +0 -0
  65. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_call_policies.cpp +0 -0
  66. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_callbacks.cpp +0 -0
  67. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_chrono.cpp +0 -0
  68. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_class.cpp +0 -0
  69. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_cmake_build/CMakeLists.txt +0 -0
  70. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_cmake_build/embed.cpp +0 -0
  71. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_cmake_build/installed_embed/CMakeLists.txt +0 -0
  72. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_cmake_build/installed_function/CMakeLists.txt +0 -0
  73. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_cmake_build/installed_target/CMakeLists.txt +0 -0
  74. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_cmake_build/main.cpp +0 -0
  75. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt +0 -0
  76. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_cmake_build/subdirectory_function/CMakeLists.txt +0 -0
  77. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_cmake_build/subdirectory_target/CMakeLists.txt +0 -0
  78. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_const_name.cpp +0 -0
  79. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_constants_and_functions.cpp +0 -0
  80. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_copy_move.cpp +0 -0
  81. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_custom_type_casters.cpp +0 -0
  82. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_custom_type_setup.cpp +0 -0
  83. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_docstring_options.cpp +0 -0
  84. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_eigen_matrix.cpp +0 -0
  85. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_eigen_tensor.cpp +0 -0
  86. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_embed/CMakeLists.txt +0 -0
  87. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_embed/catch.cpp +0 -0
  88. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_embed/external_module.cpp +0 -0
  89. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_embed/test_interpreter.cpp +0 -0
  90. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_enum.cpp +0 -0
  91. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_eval.cpp +0 -0
  92. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_exceptions.cpp +0 -0
  93. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_factory_constructors.cpp +0 -0
  94. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_gil_scoped.cpp +0 -0
  95. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_iostream.cpp +0 -0
  96. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_kwargs_and_defaults.cpp +0 -0
  97. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_local_bindings.cpp +0 -0
  98. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_methods_and_attributes.cpp +0 -0
  99. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_modules.cpp +0 -0
  100. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_multiple_inheritance.cpp +0 -0
  101. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_numpy_array.cpp +0 -0
  102. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_numpy_dtypes.cpp +0 -0
  103. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_numpy_vectorize.cpp +0 -0
  104. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_opaque_types.cpp +0 -0
  105. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_operator_overloading.cpp +0 -0
  106. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_pickling.cpp +0 -0
  107. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_pytypes.cpp +0 -0
  108. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_sequences_and_iterators.cpp +0 -0
  109. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_smart_ptr.cpp +0 -0
  110. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_stl.cpp +0 -0
  111. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_stl_binders.cpp +0 -0
  112. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_tagbased_polymorphic.cpp +0 -0
  113. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_thread.cpp +0 -0
  114. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_type_caster_pyobject_ptr.cpp +0 -0
  115. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_union.cpp +0 -0
  116. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_unnamed_namespace_a.cpp +0 -0
  117. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_unnamed_namespace_b.cpp +0 -0
  118. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_vector_unique_ptr_member.cpp +0 -0
  119. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tests/test_virtual_functions.cpp +0 -0
  120. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tools/FindCatch.cmake +0 -0
  121. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tools/FindEigen3.cmake +0 -0
  122. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tools/FindPythonLibsNew.cmake +0 -0
  123. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tools/JoinPaths.cmake +0 -0
  124. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tools/check-style.sh +0 -0
  125. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tools/cmake_uninstall.cmake.in +0 -0
  126. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tools/codespell_ignore_lines_from_errors.py +0 -0
  127. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tools/libsize.py +0 -0
  128. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tools/make_changelog.py +0 -0
  129. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tools/pybind11.pc.in +0 -0
  130. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tools/pybind11Common.cmake +0 -0
  131. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tools/pybind11Config.cmake.in +0 -0
  132. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tools/pybind11NewTools.cmake +0 -0
  133. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tools/pybind11Tools.cmake +0 -0
  134. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tools/pyproject.toml +0 -0
  135. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tools/setup_global.py.in +0 -0
  136. {removedup-1.0.2 → removedup-1.0.4}/vendor/pybind11/tools/setup_main.py.in +0 -0
  137. {removedup-1.0.2 → removedup-1.0.4}/vendor/xxh32.hpp +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: removedup
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: Remove duplicates from parallel corpora
5
5
  Home-page: https://github.com/LibreTranslate/RemoveDUP
6
6
  Author: Piero Toffanin
@@ -0,0 +1,45 @@
1
+ #include "dedup.hpp"
2
+
3
+ std::tuple<std::string, std::string, size_t> dedup(const std::string &src, const std::string &tgt){
4
+ std::ifstream src_if(src, std::ios_base::in | std::ios_base::binary);
5
+ if (!src_if.is_open()) throw std::runtime_error("Cannot open " + src);
6
+
7
+ std::ifstream tgt_if(tgt, std::ios_base::in | std::ios_base::binary);
8
+ if (!tgt_if.is_open()) throw std::runtime_error("Cannot open " + tgt);
9
+
10
+ std::unordered_map<std::uint32_t, bool> seen;
11
+
12
+ std::string src_out = src + ".dedup";
13
+ std::string tgt_out = tgt + ".dedup";
14
+
15
+ std::ofstream src_of(src_out, std::ios::trunc);
16
+ std::ofstream tgt_of(tgt_out, std::ios::trunc);
17
+
18
+ std::string line_s = "";
19
+ std::string line_t = "";
20
+ size_t removed = 0;
21
+
22
+ while(true) {
23
+ std::getline(src_if, line_s);
24
+ std::getline(tgt_if, line_t);
25
+ if (src_if.eof()) break;
26
+
27
+ std::uint32_t hash = xxh32::hash(line_s.c_str(), static_cast<uint32_t>(line_s.size()), 0);
28
+
29
+ bool line_exists = seen.count(hash) > 0;
30
+ if (!line_exists) {
31
+ seen[hash] = true;
32
+ src_of << line_s << "\n";
33
+ tgt_of << line_t << "\n";
34
+ }else{
35
+ removed++;
36
+ }
37
+ }
38
+
39
+ src_of.close();
40
+ tgt_of.close();
41
+ src_if.close();
42
+ tgt_if.close();
43
+
44
+ return std::make_tuple(src_out, tgt_out, removed);
45
+ }
@@ -0,0 +1,10 @@
1
+ #include <iostream>
2
+ #include <fstream>
3
+ #include <unordered_map>
4
+ #include <cstring>
5
+ #include <tuple>
6
+ #include <string>
7
+
8
+ #include "vendor/xxh32.hpp"
9
+
10
+ std::tuple<std::string, std::string, size_t> dedup(const std::string &src, const std::string &tgt);
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: removedup
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: Remove duplicates from parallel corpora
5
5
  Home-page: https://github.com/LibreTranslate/RemoveDUP
6
6
  Author: Piero Toffanin
@@ -124,7 +124,7 @@ class CMakeBuild(build_ext):
124
124
 
125
125
  setup(
126
126
  name="removedup",
127
- version="1.0.2",
127
+ version="1.0.4",
128
128
  author="Piero Toffanin",
129
129
  author_email="pt@masseranolabs.com",
130
130
  url="https://github.com/LibreTranslate/RemoveDUP",
removedup-1.0.2/dedup.cpp DELETED
@@ -1,102 +0,0 @@
1
- #include "dedup.hpp"
2
-
3
- std::tuple<std::string, std::string, size_t> dedup(const std::string &src, const std::string &tgt){
4
- #if defined(_WIN32) || defined(_WIN64)
5
- HANDLE file_handle = CreateFile(src.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
6
- if (file_handle == INVALID_HANDLE_VALUE) {
7
- throw std::runtime_error("Unable to open " + src);
8
- }
9
-
10
- DWORD file_size = GetFileSize(file_handle, NULL);
11
- HANDLE file_mapping = CreateFileMapping(file_handle, NULL, PAGE_READONLY, 0, 0, NULL);
12
- if (file_mapping == NULL) {
13
- CloseHandle(file_handle);
14
- throw std::runtime_error("File mapping failed.");
15
- }
16
-
17
- const char* file_data = static_cast<const char*>(MapViewOfFile(file_mapping, FILE_MAP_READ, 0, 0, file_size));
18
- if (file_data == NULL) {
19
- CloseHandle(file_mapping);
20
- CloseHandle(file_handle);
21
- throw std::runtime_error("Memory mapping failed.");
22
- }
23
- #else
24
- int fd = open(src.c_str(), O_RDONLY);
25
- if (fd == -1) throw std::runtime_error("Unable to open " + src);
26
-
27
- struct stat file_stat;
28
- if (fstat(fd, &file_stat) == -1) {
29
- close(fd);
30
- throw std::runtime_error("Unable to get file size for " + src);
31
- }
32
-
33
- off_t file_size = file_stat.st_size;
34
- const char* file_data = static_cast<const char*>(mmap(NULL, file_size, PROT_READ, MAP_PRIVATE, fd, 0));
35
- if (file_data == MAP_FAILED) {
36
- close(fd);
37
- throw std::runtime_error("Memory mapping failed.");
38
- }
39
-
40
- #endif
41
-
42
- std::unordered_multimap<std::uint32_t, std::string_view> lines;
43
-
44
- std::ifstream tgt_is(tgt);
45
- if (!tgt_is.is_open()) throw std::runtime_error("Cannot open " + tgt);
46
-
47
- std::string src_out = src + ".dedup";
48
- std::string tgt_out = tgt + ".dedup";
49
-
50
- std::ofstream src_of(src_out, std::ios::trunc);
51
- std::ofstream tgt_of(tgt_out, std::ios::trunc);
52
-
53
- const char* line_start = file_data;
54
- const char* line_end = file_data;
55
- std::string line_buf = "";
56
- size_t removed = 0;
57
-
58
- for (const char* ptr = file_data; ptr < file_data + file_size; ++ptr) {
59
- if (*ptr == '\n' || ptr == file_data + file_size - 1) {
60
- std::getline(tgt_is, line_buf);
61
-
62
- line_end = ptr + 1;
63
- std::string_view line_view(line_start, line_end - line_start);
64
-
65
- std::uint32_t hash = xxh32::hash(line_start, static_cast<uint32_t>(line_end - line_start), 0);
66
- auto range = lines.equal_range(hash);
67
-
68
- bool line_exists = false;
69
- for (auto it = range.first; it != range.second; ++it) {
70
- if (it->second == line_view) {
71
- line_exists = true;
72
- break;
73
- }
74
- }
75
-
76
- if (!line_exists) {
77
- lines.emplace(hash, line_view);
78
-
79
- src_of << line_view;
80
- tgt_of << line_buf << (*ptr == '\n' ? "\n" : "");
81
- }else{
82
- removed++;
83
- }
84
-
85
- line_start = line_end;
86
- }
87
- }
88
-
89
- #if defined(_WIN32) || defined(_WIN64)
90
- UnmapViewOfFile(file_data);
91
- CloseHandle(file_mapping);
92
- CloseHandle(file_handle);
93
- #else
94
- munmap(const_cast<char*>(file_data), file_stat.st_size);
95
- close(fd);
96
- #endif
97
-
98
- src_of.close();
99
- tgt_of.close();
100
-
101
- return std::make_tuple(src_out, tgt_out, removed);
102
- }
removedup-1.0.2/dedup.hpp DELETED
@@ -1,21 +0,0 @@
1
- #include <iostream>
2
- #include <fstream>
3
- #include <unordered_map>
4
- #include <string_view>
5
- #include <cstring>
6
- #include <tuple>
7
- #include <variant>
8
- #include <string>
9
-
10
- #if defined(_WIN32) || defined(_WIN64)
11
- #include <windows.h>
12
- #else
13
- #include <sys/mman.h>
14
- #include <sys/stat.h>
15
- #include <fcntl.h>
16
- #include <unistd.h>
17
- #endif
18
-
19
- #include "vendor/xxh32.hpp"
20
-
21
- std::tuple<std::string, std::string, size_t> dedup(const std::string &src, const std::string &tgt);
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