From 494223ed148d6837f962d44420aa9dfac5066c9e Mon Sep 17 00:00:00 2001 From: klingbolt Date: Wed, 19 Feb 2025 22:30:39 -0500 Subject: [PATCH 1/2] changed split categories to make file names from normalized Display Names --- .../input/pack/xml_file.xml | 52 +++++++++--------- .../output_proto/parent1.guildpoint | Bin 300 -> 453 bytes .../output_proto/parent2.guildpoint | Bin 300 -> 453 bytes .../output_xml/xml_file.xml | 52 +++++++++--------- .../input/pack/xml_file.xml | 52 +++++++++--------- .../output_proto/parent1.child1.guildpoint | Bin 104 -> 162 bytes .../output_proto/parent1.child2.guildpoint | Bin 104 -> 162 bytes .../output_proto/parent1.child3.guildpoint | Bin 104 -> 162 bytes .../output_proto/parent2.child1.guildpoint | Bin 104 -> 162 bytes .../output_proto/parent2.child2.guildpoint | Bin 104 -> 162 bytes .../output_proto/parent2.child3.guildpoint | Bin 104 -> 162 bytes .../output_xml/xml_file.xml | 52 +++++++++--------- xml_converter/src/packaging_protobin.cpp | 11 ++-- 13 files changed, 111 insertions(+), 108 deletions(-) diff --git a/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_0/input/pack/xml_file.xml b/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_0/input/pack/xml_file.xml index 732073a3..fe82c5b9 100644 --- a/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_0/input/pack/xml_file.xml +++ b/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_0/input/pack/xml_file.xml @@ -1,36 +1,36 @@ - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + diff --git a/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_0/output_proto/parent1.guildpoint b/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_0/output_proto/parent1.guildpoint index 3650810a4bca7108c4cdb02a596c337b361bc3f7..e663e047929a4b38ce1ebe447deef97a0d289d01 100644 GIT binary patch literal 453 zcmd-&#LUGWkXV$OS7IpC$;id#oROK6Vko4<#qC~{n3s|a=1OrY7&)=>GBDh8a^l#~ z{k-FR)BbQ&HAZkX4}fYm1JxAl`9BF&jWJx!BcPhCKsAEj?9agk?*IiiUZ1&WU2EhQ zgj zV^lK`ZeezYgv&%7X9H9<2)D2R)qujqD6KggRSm)|tUxuOaJfAH@G`htn1F(ya4FEg Udj>9e0_Z?pmsOrOO`VPd0C(q#r~m)} literal 300 zcmd;D$s`mdBr3(JVC2Ng%fN8Y$%$h__w$bPP5Z-V^{ycH-c z_|5(t+=x3s!Hw5vE?U)kh_i2nzNCFS%JbJcVC`=cp2PmCZHh5-39u0&%gyw P04>yYS><`t)af_?PW)PY diff --git a/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_0/output_proto/parent2.guildpoint b/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_0/output_proto/parent2.guildpoint index fcbb774511b9655c16a61c5b4014dd42fa78b15a..743ace6a8463fb6513a5bfd0cc650c960c9b395e 100644 GIT binary patch literal 453 zcmd-&#LUGWkXV$OS7Id8$;id#oROK6Vko4<#qC~{n3s|a=1OrY7&)=>GB5-?J8^92 ze%^7RX@5AX8Y8%x5TKgPKsAMX{!cal3RJTds7C0U{W-W`5KwUA^_h#-w?=+J zxWx$73`4l`Sg2bzhBLaLszJCV4(gVmiH`NCY7lOThq~qSsm5J!!(*UsnGiMm0m3cD zsAeGCk`8stBpqi1R5b{o`DN`00nhj LR(aksbvh0J{Njg8 literal 300 zcmd;D$s`mdBr3(JVC2Ng%fJxq?8LF5`+3KOrv2ea!XZH6%|PM8J^v>m35NoOw*rNQ zzS*CH8xaH)+<1NFqV=tjUr@}Bg_^xFoY4izkT|H>K@%P8k%Z%+W`91_xC?G}4Akri zQL`VQn4Jzadyhdi diff --git a/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_0/output_xml/xml_file.xml b/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_0/output_xml/xml_file.xml index bc807335..a7f04db5 100644 --- a/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_0/output_xml/xml_file.xml +++ b/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_0/output_xml/xml_file.xml @@ -1,36 +1,36 @@ - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + diff --git a/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_1/input/pack/xml_file.xml b/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_1/input/pack/xml_file.xml index 45f77646..806e2628 100644 --- a/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_1/input/pack/xml_file.xml +++ b/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_1/input/pack/xml_file.xml @@ -1,36 +1,36 @@ - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + diff --git a/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_1/output_proto/parent1.child1.guildpoint b/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_1/output_proto/parent1.child1.guildpoint index 686a61c6c6d2a03b3544adbbf4711b25ba95109a..312ffb420d117bc5f453e519295f7147b3dbc611 100644 GIT binary patch literal 162 zcmd;@&&b6dkXV$OS7IpC$;id#oROK6Vko4<#qC~{n3s|a=1OrY7&)=>GBDh8a^l#~ z{k-FR)BbQ&HAZkX4}fYm1JxAl`9BF&jWJx!BcPhCKsAEj?9agk?*IiiUZ1&WU2EhQ PCk|bgRh~CZosI(laVRuz delta 59 zcmZ3)m|?<|CKM$kD#fW_ z(EYq)LpY-gsv0A>nlC^#n}KQqCpy-nsxgME`36+86{zOZsm5J!!4E*ejn`)`>W`ZJ Pz==cGWtHbmQ>Wtq;v+Lr delta 59 zcmZ3)m|?<|CKM$kD#fW_|k9qWZeC+3*| E0KR1qnE(I) diff --git a/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_1/output_proto/parent1.child3.guildpoint b/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_1/output_proto/parent1.child3.guildpoint index b3f4d3ea7e9590dfa7536be3dcc6d458f051aa6d..6359a4f62410c6a24d26288c79e44d420abc55a4 100644 GIT binary patch literal 162 zcmd;@&&b6dkXV$OS7IpC$;id#oROK6Vl1S@#qC~{n3s|a;u=bEDi}Gj@-i?mJ3Db~ z=ziWYQODT;RgDo`4GU1sW}q6QwB~G7HO6o?tUxtefod+#KfDYs$OIJJczx!g0{y#Z PoH%q{R(akubvh0J*ZVIh delta 59 zcmZ3)m|?<|CKM$kD#fW_GB5-?J8^92 ze%^7RX@5AX8Y8%x5TKgPKsAMX{!cal3RJTds7C0U{W-W`5KwUA^_h#-w?=+( O;?Q+j<$250={Nx9W-?0v delta 59 zcmZ3)m|?<|CKM$kD#fW_0#Id3KdB=sO{ozQ$Awc2HK;gnY|0fBFPRug_ E0L0)ClmGw# diff --git a/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_1/output_proto/parent2.child2.guildpoint b/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_1/output_proto/parent2.child2.guildpoint index 340672fb60cd5bdff1645c19132888e0575f32ca..0b1576c917410b35eb3fd7c27117d8d5c12576b0 100644 GIT binary patch literal 162 zcmd;@&&b6dkXV$OS7Id8$;id#oROK6VkD%*#qC~{n3s|a;u=bEDi}Gj@-i^QIy-S} z=ziX@F`Ur_RgDo`O&n0oW}up&iH`NCYK-A(;(=U10cO;Rxh delta 59 zcmZ3)m|?<|CKM$kD#fW_x0j#Id3KdB-FjX9FbR45094ps;aTbGDG^#5@xK Dn+p$4 diff --git a/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_1/output_xml/xml_file.xml b/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_1/output_xml/xml_file.xml index 44c3c53a..f582da77 100644 --- a/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_1/output_xml/xml_file.xml +++ b/xml_converter/integration_tests/test_cases/xml_split_by_category_depth_1/output_xml/xml_file.xml @@ -1,36 +1,36 @@ - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + diff --git a/xml_converter/src/packaging_protobin.cpp b/xml_converter/src/packaging_protobin.cpp index ca7bac73..9752baa9 100644 --- a/xml_converter/src/packaging_protobin.cpp +++ b/xml_converter/src/packaging_protobin.cpp @@ -295,15 +295,18 @@ void _category_filter_by_depth( int target_depth, map* category_hierarchy, vector parent_name, + vector parent_display_name, int current_depth) { for (auto it = marker_categories->begin(); it != marker_categories->end(); it++) { vector child_name = parent_name; - child_name.push_back(it->first); + vector child_display_name = parent_display_name; + child_name.push_back(it->second.name); + child_display_name.push_back(normalize(it->second.display_name)); if (target_depth == current_depth) { - (*category_hierarchy)[join(child_name, ".")].add_path(child_name, true); + (*category_hierarchy)[join(child_display_name, ".")].add_path(child_name, true); continue; } - _category_filter_by_depth(&(it->second.children), target_depth, category_hierarchy, child_name, current_depth + 1); + _category_filter_by_depth(&(it->second.children), target_depth, category_hierarchy, child_name, child_display_name, current_depth + 1); } } @@ -311,7 +314,7 @@ map category_filter_by_depth( const map* marker_categories, const int split_by_category_depth) { map category_hierarchy; - _category_filter_by_depth(marker_categories, split_by_category_depth, &category_hierarchy, {}, 0); + _category_filter_by_depth(marker_categories, split_by_category_depth, &category_hierarchy, {}, {}, 0); return category_hierarchy; } From a717f812ffe126a044298abf0c94f9593952c99e Mon Sep 17 00:00:00 2001 From: klingbolt Date: Tue, 25 Feb 2025 20:13:54 -0500 Subject: [PATCH 2/2] added test with proto input to test name similarities --- .../input/pack/markers.guildpoint | Bin 0 -> 884 bytes .../output_proto/parent1.child1.guildpoint | Bin 0 -> 162 bytes .../output_proto/parent1.child2.guildpoint | Bin 0 -> 162 bytes .../output_proto/parent1.child3.guildpoint | Bin 0 -> 162 bytes .../output_proto/parent2.child1.guildpoint | Bin 0 -> 162 bytes .../output_proto/parent2.child2.guildpoint | Bin 0 -> 162 bytes .../output_proto/parent2.child3.guildpoint | Bin 0 -> 162 bytes .../output_xml/xml_file.xml | 63 ++++++++++++++++++ .../testcase.yaml | 6 ++ 9 files changed, 69 insertions(+) create mode 100644 xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/input/pack/markers.guildpoint create mode 100644 xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/output_proto/parent1.child1.guildpoint create mode 100644 xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/output_proto/parent1.child2.guildpoint create mode 100644 xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/output_proto/parent1.child3.guildpoint create mode 100644 xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/output_proto/parent2.child1.guildpoint create mode 100644 xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/output_proto/parent2.child2.guildpoint create mode 100644 xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/output_proto/parent2.child3.guildpoint create mode 100644 xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/output_xml/xml_file.xml create mode 100644 xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/testcase.yaml diff --git a/xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/input/pack/markers.guildpoint b/xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/input/pack/markers.guildpoint new file mode 100644 index 0000000000000000000000000000000000000000..68f71ae1b959fe9736061e16ea970005c54680fb GIT binary patch literal 884 zcmdGBDh8a^l#~ z{k-FR)BbQ&HAZkX4}fYm1JxAl`9BF&jWJx!BcPhCKsAEj?9agk?*IiiUZ1&WU2EhQ zgj zV^lK`ZeezYgv&%7X9H9<2)D2R)qujqD6KggRSm)|tUxuOaJfAH@G`htn1F(ya4FEg zd&Y@F*JYLGO;e}iT!@%6LbwoT%mqVTcmYq$g+N_ch$rSkp)M3cj=3PH3)d4DbFomj zY{V0DaZtAe;fc9;s9QcG$6O55Efa`~xpb&oCgF*>45(X-@x)vv)Gb$#V=fKqmO^;U I-2%oO00@f?!~g&Q literal 0 HcmV?d00001 diff --git a/xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/output_proto/parent1.child1.guildpoint b/xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/output_proto/parent1.child1.guildpoint new file mode 100644 index 0000000000000000000000000000000000000000..312ffb420d117bc5f453e519295f7147b3dbc611 GIT binary patch literal 162 zcmd;@&&b6dkXV$OS7IpC$;id#oROK6Vko4<#qC~{n3s|a=1OrY7&)=>GBDh8a^l#~ z{k-FR)BbQ&HAZkX4}fYm1JxAl`9BF&jWJx!BcPhCKsAEj?9agk?*IiiUZ1&WU2EhQ PCk|bgRh~CZosI(laVRuz literal 0 HcmV?d00001 diff --git a/xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/output_proto/parent1.child2.guildpoint b/xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/output_proto/parent1.child2.guildpoint new file mode 100644 index 0000000000000000000000000000000000000000..274bdec8bcf7760c98489d861c8311ffff83cfe9 GIT binary patch literal 162 zcmd;@&&b6dkXV$OS7IpC$;id#oROK6VkD%*#qC~{n3s|a;u=bEDi}Gj@-i@da&qF> z(EYq)LpY-gsv0A>nlC^#n}KQqCpy-nsxgME`36+86{zOZsm5J!!4E*ejn`)`>W`ZJ Pz==cGWtHbmQ>Wtq;v+Lr literal 0 HcmV?d00001 diff --git a/xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/output_proto/parent1.child3.guildpoint b/xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/output_proto/parent1.child3.guildpoint new file mode 100644 index 0000000000000000000000000000000000000000..6359a4f62410c6a24d26288c79e44d420abc55a4 GIT binary patch literal 162 zcmd;@&&b6dkXV$OS7IpC$;id#oROK6Vl1S@#qC~{n3s|a;u=bEDi}Gj@-i?mJ3Db~ z=ziWYQODT;RgDo`4GU1sW}q6QwB~G7HO6o?tUxtefod+#KfDYs$OIJJczx!g0{y#Z PoH%q{R(akubvh0J*ZVIh literal 0 HcmV?d00001 diff --git a/xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/output_proto/parent2.child1.guildpoint b/xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/output_proto/parent2.child1.guildpoint new file mode 100644 index 0000000000000000000000000000000000000000..face06e5b8856b52b9c01be0d07fb1879bd57aea GIT binary patch literal 162 zcmd;@&&b6dkXV$OS7Id8$;id#oROK6Vko4<#qC~{n3s|a=1OrY7&)=>GB5-?J8^92 ze%^7RX@5AX8Y8%x5TKgPKsAMX{!cal3RJTds7C0U{W-W`5KwUA^_h#-w?=+( O;?Q+j<$250={Nx9W-?0v literal 0 HcmV?d00001 diff --git a/xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/output_proto/parent2.child2.guildpoint b/xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/output_proto/parent2.child2.guildpoint new file mode 100644 index 0000000000000000000000000000000000000000..0b1576c917410b35eb3fd7c27117d8d5c12576b0 GIT binary patch literal 162 zcmd;@&&b6dkXV$OS7Id8$;id#oROK6VkD%*#qC~{n3s|a;u=bEDi}Gj@-i^QIy-S} z=ziX@F`Ur_RgDo`O&n0oW}up&iH`NCYK-A(;(=U10cO;Rxh literal 0 HcmV?d00001 diff --git a/xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/output_proto/parent2.child3.guildpoint b/xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/output_proto/parent2.child3.guildpoint new file mode 100644 index 0000000000000000000000000000000000000000..1437522bf0932f91bc734f0a6e3f9b671f6adf95 GIT binary patch literal 162 zcmd;@&&b6dkXV$OS7Id8$;id#oROK6Vl1S@#qC~{n3s|a;u=bEDi}Gj@-i@_J3Db~ z=ziWYNypg$RgDo`O$JcSW}q75wB~G7HO6o?nLssLfoiVIKfDYsm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/testcase.yaml b/xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/testcase.yaml new file mode 100644 index 00000000..c9ed0b72 --- /dev/null +++ b/xml_converter/integration_tests/test_cases/proto_split_by_category_depth_1/testcase.yaml @@ -0,0 +1,6 @@ +input_paths: + "pack": "proto" +expected_stdout: | +expected_stderr: | +expected_returncode: 0 +split_by_category: 1